Class AttributeContainerMap

All Implemented Interfaces:
Attributes, Container, Destroyable, Dumpable, Dumpable.DumpableContainer, LifeCycle

public class AttributeContainerMap extends ContainerLifeCycle implements Attributes
An Attributes implementation that holds it's values in an immutable ContainerLifeCycle
  • Constructor Details

    • AttributeContainerMap

      public AttributeContainerMap()
  • Method Details

    • setAttribute

      public Object setAttribute(String name, Object attribute)
      Description copied from interface: Attributes
      Set an attribute
      Specified by:
      setAttribute in interface Attributes
      Parameters:
      name - the attribute to set
      attribute - the value to set. A null value is equivalent to removing the attribute.
      Returns:
      the previous value of the attribute if set, else null
    • removeAttribute

      public Object removeAttribute(String name)
      Description copied from interface: Attributes
      Remove an attribute
      Specified by:
      removeAttribute in interface Attributes
      Parameters:
      name - the attribute to remove
      Returns:
      the value of the attribute if removed, else null
    • getAttribute

      public Object getAttribute(String name)
      Description copied from interface: Attributes
      Get an attribute
      Specified by:
      getAttribute in interface Attributes
      Parameters:
      name - the attribute to get
      Returns:
      the value of the attribute
    • getAttributeNameSet

      public Set<String> getAttributeNameSet()
      Description copied from interface: Attributes
      Get the immutable set of attribute names.
      Specified by:
      getAttributeNameSet in interface Attributes
      Returns:
      Set of attribute names
    • clearAttributes

      public void clearAttributes()
      Description copied from interface: Attributes
      Clear all attribute names
      Specified by:
      clearAttributes in interface Attributes
    • dump

      public void dump(Appendable out, String indent) throws IOException
      Description copied from interface: Dumpable
      Dump this object (and children) into an Appendable using the provided indent after any new lines. The indent should not be applied to the first object dumped.
      Specified by:
      dump in interface Dumpable
      Overrides:
      dump in class ContainerLifeCycle
      Parameters:
      out - The appendable to dump to
      indent - The indent to apply after any new lines.
      Throws:
      IOException - if unable to write to Appendable
    • toString

      public String toString()
      Overrides:
      toString in class AbstractLifeCycle