Package io.netty.util
Class DefaultAttributeMap
- java.lang.Object
-
- io.netty.util.DefaultAttributeMap
-
- All Implemented Interfaces:
AttributeMap
- Direct Known Subclasses:
AbstractChannel
public class DefaultAttributeMap extends java.lang.Object implements AttributeMap
DefaultAttributeMapimplementation which not exibit any blocking behaviour on attribute lookup while using a copy-on-write approach on the modify path.
Attributes lookup and remove exibitO(logn)time worst-case complexity, henceattribute::set(null)is to be preferred toremove.
-
-
Constructor Summary
Constructors Constructor Description DefaultAttributeMap()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Attribute<T>attr(AttributeKey<T> key)Get theAttributefor the givenAttributeKey.<T> booleanhasAttr(AttributeKey<T> key)
-
-
-
Method Detail
-
attr
public <T> Attribute<T> attr(AttributeKey<T> key)
Description copied from interface:AttributeMapGet theAttributefor the givenAttributeKey. This method will never return null, but may return anAttributewhich does not have a value set yet.- Specified by:
attrin interfaceAttributeMap
-
hasAttr
public <T> boolean hasAttr(AttributeKey<T> key)
Description copied from interface:AttributeMap- Specified by:
hasAttrin interfaceAttributeMap
-
-