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 theAttribute
which 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 accessAttribute
out 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 boolean
exists(java.lang.String name)
static <T> AttributeKey<T>
newInstance(java.lang.String name)
Creates a newAttributeKey
for the givenname
or fail with anIllegalArgumentException
if aAttributeKey
for the givenname
exists.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 theAttributeKey
which has the specifiedname
.
-
-
-
Method Detail
-
valueOf
public static <T> AttributeKey<T> valueOf(java.lang.String name)
Returns the singleton instance of theAttributeKey
which 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 newAttributeKey
for the givenname
or fail with anIllegalArgumentException
if aAttributeKey
for the givenname
exists.
-
valueOf
public static <T> AttributeKey<T> valueOf(java.lang.Class<?> firstNameComponent, java.lang.String secondNameComponent)
-
-