-
Notifications
You must be signed in to change notification settings - Fork 24
What are attributes?
Attributes are typed key-value pairs such as username:String = Ellzord
that are stored within containers.
What is an AttributeType?
An AttributeType defines the value Type for an attribute value. Because it is backed by Type it can differentiate between Collection<String>
and Collection<Integer>
(see Creating an AttributeType for more information). Rather than pairing the AttributeType with the key name over and over NamedAttributeType can be used. The attribute utilities cover a bunch of useful type methods (see Useful utility methods).
What is an AttributeContainer?
An AttributeContainer is an interface
that provides all the method definitions for adding, removing and retrieving attribute values. There is a default implementation provided, DefaultAttributeContainer, which is thread-safe and fully featured. DefaultAttributeContainer.Builder (see API docs) can be used to easily build a container instance.
What is an AttributeListener?
When attribute values are added, changed internally (manually fired) or removed an AttributeEvent is created and handed out to all AttributeListeners matching the name and type.
For some handy attribute related methods see Attributes (API docs for Attributes):
- Primitive AttributeTypes
- Easy create primitive NamedAttributeTypes
- Create unknown AttributeType
- Easy create simple AttributeType
- Empty AttributeContainer
- Unmodifiable AttributeContainer
Check out the Example projects and Code snippets!
Getting Started
- Getting the latest release
- Building from source
- Example projects
- Code snippets
- How to contribute
- Have bugs or questions?
How To Use
- JALSE
- Entities
- Attributes
- Actions
- Tags
Misc