Class Attributes.Lazy

java.lang.Object
org.eclipse.jetty.util.Attributes.Lazy
All Implemented Interfaces:
Attributes, Dumpable
Direct Known Subclasses:
HttpConversation
Enclosing interface:
Attributes

public static class Attributes.Lazy extends Object implements Attributes, Dumpable
An Attributes implementation that lazily creates a backing map iff it is actually needed.
  • Constructor Details

    • Lazy

      public Lazy()
  • Method Details

    • asAttributeMap

      public Map<String,Object> asAttributeMap()
      Specified by:
      asAttributeMap in interface Attributes
    • 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
    • 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
    • getAttribute

      public Object getAttribute(String name)
      Description copied from interface: Attributes
      Get an attribute by name. Some attributes may be "hidden" attributes, in that they are only found by an explicit call to getAttribute(String) and they do not otherwise appear in Attributes.getAttributeNameSet() or Attributes.asAttributeMap().
      Specified by:
      getAttribute in interface Attributes
      Parameters:
      name - the attribute to get
      Returns:
      the value of the attribute, or null if no such attribute exists
    • 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, or an empty set if there are no attributes.
    • clearAttributes

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

      public int size()
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • addAll

      public void addAll(Attributes attributes)
    • dump

      public String dump()
      Specified by:
      dump in interface Dumpable
    • 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
      Parameters:
      out - The appendable to dump to
      indent - The indent to apply after any new lines.
      Throws:
      IOException - if unable to write to Appendable
    • hashCode

      public int hashCode()
      Specified by:
      hashCode in interface Attributes
      Overrides:
      hashCode in class Object
    • equals

      public boolean equals(Object o)
      Specified by:
      equals in interface Attributes
      Overrides:
      equals in class Object