Interface AttributeHolder

All Known Implementing Classes:
IndexedAttributeHolder

public interface AttributeHolder
Interface declares common functionality for objects, which have associated Attributes.
Author:
Alexey Stashok
See Also:
  • Method Details

    • removeAttribute

      Object removeAttribute(String name)
      Remove a name/value object.
      Parameters:
      name - - name of an attribute
      Returns:
      attribute which has been removed
    • setAttribute

      void setAttribute(String name, Object value)
      Set a name/value object.
      Parameters:
      name - - name of an attribute
      value - - value of named attribute
    • getAttribute

      Object getAttribute(String name)
      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

      Object getAttribute(String name, Supplier initializer)
      Return an object based on a name.
      Parameters:
      name - - name of an attribute
      initializer - 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

      Set<String> getAttributeNames()
      Return a Set of attribute names.
      Returns:
      - Set of 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 an IndexedAttributeAccessor, which will make Attribute access as fast as access to array element.
      Returns:
      IndexedAttributeAccessor.
    • copyTo

      void copyTo(AttributeHolder dstAttributes)
      Copies attributes from this AttributeHolder to the dstAttributes.
      Parameters:
      dstAttributes -
    • copyFrom

      void copyFrom(AttributeHolder srcAttributes)
      Copies attributes from the srcAttributes to this AttributeHolder
      Parameters:
      srcAttributes -