Package org.eclipse.jetty.util
Class Attributes.Lazy
java.lang.Object
org.eclipse.jetty.util.Attributes.Lazy
- All Implemented Interfaces:
Attributes
,Dumpable
- Direct Known Subclasses:
HttpChannelState.ChannelRequest
,HttpConversation
- Enclosing interface:
- Attributes
An
Attributes
implementation that lazily creates a backing map iff it is actually needed.-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.Attributes
Attributes.Layer, Attributes.Lazy, Attributes.Mapped, Attributes.Synthetic, Attributes.Wrapper
Nested classes/interfaces inherited from interface org.eclipse.jetty.util.component.Dumpable
Dumpable.DumpableContainer
-
Field Summary
Fields inherited from interface org.eclipse.jetty.util.Attributes
NULL
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addAll
(Attributes attributes) void
Clear all attribute namesdump()
void
dump
(Appendable out, String indent) Dump this object (and children) into an Appendable using the provided indent after any new lines.boolean
getAttribute
(String name) Get an attributeGet the immutable set of attribute names.int
hashCode()
removeAttribute
(String name) Remove an attributesetAttribute
(String name, Object attribute) Set an attributeint
size()
toString()
-
Constructor Details
-
Lazy
public Lazy()
-
-
Method Details
-
asAttributeMap
- Specified by:
asAttributeMap
in interfaceAttributes
-
removeAttribute
Description copied from interface:Attributes
Remove an attribute- Specified by:
removeAttribute
in interfaceAttributes
- Parameters:
name
- the attribute to remove- Returns:
- the value of the attribute if removed, else
null
-
setAttribute
Description copied from interface:Attributes
Set an attribute- Specified by:
setAttribute
in interfaceAttributes
- Parameters:
name
- the attribute to setattribute
- 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
Description copied from interface:Attributes
Get an attribute- Specified by:
getAttribute
in interfaceAttributes
- Parameters:
name
- the attribute to get- Returns:
- the value of the attribute, or
null
if no such attribute exists
-
getAttributeNameSet
Description copied from interface:Attributes
Get the immutable set of attribute names.- Specified by:
getAttributeNameSet
in interfaceAttributes
- 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 interfaceAttributes
-
size
public int size() -
toString
-
addAll
-
dump
-
dump
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 interfaceDumpable
- Parameters:
out
- The appendable to dump toindent
- The indent to apply after any new lines.- Throws:
IOException
- if unable to write to Appendable
-
hashCode
public int hashCode()- Specified by:
hashCode
in interfaceAttributes
- Overrides:
hashCode
in classObject
-
equals
- Specified by:
equals
in interfaceAttributes
- Overrides:
equals
in classObject
-