- java.lang.Object
-
- io.netty5.util.DefaultAttributeMap
-
- All Implemented Interfaces:
AttributeMap
- Direct Known Subclasses:
AbstractChannel
public class DefaultAttributeMap extends Object implements AttributeMap
DefaultAttributeMap
implementation 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 theAttribute
for the givenAttributeKey
.<T> boolean
hasAttr(AttributeKey<T> key)
-
-
-
Method Detail
-
attr
public <T> Attribute<T> attr(AttributeKey<T> key)
Description copied from interface:AttributeMap
Get theAttribute
for the givenAttributeKey
. This method will never return null, but may return anAttribute
which does not have a value set yet.- Specified by:
attr
in interfaceAttributeMap
-
hasAttr
public <T> boolean hasAttr(AttributeKey<T> key)
Description copied from interface:AttributeMap
- Specified by:
hasAttr
in interfaceAttributeMap
-
-