Package io.netty.util
Class AttributeKey<T>
- java.lang.Object
-
- io.netty.util.AbstractConstant<AttributeKey<T>>
-
- io.netty.util.AttributeKey<T>
-
- Type Parameters:
T- the type of theAttributewhich can be accessed via thisAttributeKey.
- All Implemented Interfaces:
Constant<AttributeKey<T>>,java.lang.Comparable<AttributeKey<T>>
public final class AttributeKey<T> extends AbstractConstant<AttributeKey<T>>
Key which can be used to accessAttributeout of theAttributeMap. Be aware that it is not be possible to have multiple keys with the same name.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static booleanexists(java.lang.String name)static <T> AttributeKey<T>newInstance(java.lang.String name)Creates a newAttributeKeyfor the givennameor fail with anIllegalArgumentExceptionif aAttributeKeyfor the givennameexists.static <T> AttributeKey<T>valueOf(java.lang.Class<?> firstNameComponent, java.lang.String secondNameComponent)static <T> AttributeKey<T>valueOf(java.lang.String name)Returns the singleton instance of theAttributeKeywhich has the specifiedname.
-
-
-
Method Detail
-
valueOf
public static <T> AttributeKey<T> valueOf(java.lang.String name)
Returns the singleton instance of theAttributeKeywhich has the specifiedname.
-
exists
public static boolean exists(java.lang.String name)
-
newInstance
public static <T> AttributeKey<T> newInstance(java.lang.String name)
Creates a newAttributeKeyfor the givennameor fail with anIllegalArgumentExceptionif aAttributeKeyfor the givennameexists.
-
valueOf
public static <T> AttributeKey<T> valueOf(java.lang.Class<?> firstNameComponent, java.lang.String secondNameComponent)
-
-