- All Known Implementing Classes:
IndexedAttributeHolder
public interface AttributeHolder
Interface declares common functionality for objects, which have associated
Attributes.- Author:
- Alexey Stashok
- See Also:
-
IndexedAttributeHolderNamedAttributeHolder
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Clear all the attributes.voidcopyFrom(AttributeHolder srcAttributes) Copies attributes from the srcAttributes to this AttributeHoldervoidcopyTo(AttributeHolder dstAttributes) Copies attributes from this AttributeHolder to the dstAttributes.getAttribute(String name) Return an object based on a name.getAttribute(String name, Supplier initializer) Return an object based on a name.Get AttributeBuilder, associated with this holderReturn aSetof attribute names.If AttributeHolder supports attribute access by index - it will return anIndexedAttributeAccessor, which will makeAttributeaccess as fast as access to array element.voidrecycle()Recycle AttributeHolderremoveAttribute(String name) Remove a name/value object.voidsetAttribute(String name, Object value) Set a name/value object.
-
Method Details
-
removeAttribute
Remove a name/value object.- Parameters:
name- - name of an attribute- Returns:
- attribute which has been removed
-
setAttribute
Set a name/value object.- Parameters:
name- - name of an attributevalue- - value of named attribute
-
getAttribute
Return an object based on a name.- Parameters:
name- - name of an attribute- Returns:
- - attribute value for the name, null if name does not exist in attributes
-
getAttribute
Return an object based on a name.- Parameters:
name- - name of an attributeinitializer- the initializer to be used to assign a default attribute value, in case it hasn't been assigned- Returns:
- - attribute value for the name, null if name does not exist in attributes
- Since:
- 2.3.18
-
getAttributeNames
Return aSetof attribute names.- Returns:
- -
Setof attribute names
-
clear
void clear()Clear all the attributes. -
recycle
void recycle()Recycle AttributeHolder -
getAttributeBuilder
AttributeBuilder getAttributeBuilder()Get AttributeBuilder, associated with this holder- Returns:
- AttributeBuilder
-
getIndexedAttributeAccessor
IndexedAttributeAccessor getIndexedAttributeAccessor()If AttributeHolder supports attribute access by index - it will return anIndexedAttributeAccessor, which will makeAttributeaccess as fast as access to array element.- Returns:
IndexedAttributeAccessor.
-
copyTo
Copies attributes from this AttributeHolder to the dstAttributes.- Parameters:
dstAttributes-
-
copyFrom
Copies attributes from the srcAttributes to this AttributeHolder- Parameters:
srcAttributes-
-