- java.lang.Object
-
- io.netty5.util.AbstractConstant<AttributeKey<T>>
-
- io.netty5.util.AttributeKey<T>
-
- Type Parameters:
T
- the type of theAttribute
which can be accessed via thisAttributeKey
.
- All Implemented Interfaces:
Constant<AttributeKey<T>>
,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(String name)
static <T> AttributeKey<T>
newInstance(String name)
Creates a newAttributeKey
for the givenname
or fail with anIllegalArgumentException
if aAttributeKey
for the givenname
exists.static <T> AttributeKey<T>
valueOf(Class<?> firstNameComponent, String secondNameComponent)
static <T> AttributeKey<T>
valueOf(String name)
Returns the singleton instance of theAttributeKey
which has the specifiedname
.
-
-
-
Method Detail
-
valueOf
public static <T> AttributeKey<T> valueOf(String name)
Returns the singleton instance of theAttributeKey
which has the specifiedname
.
-
exists
public static boolean exists(String name)
-
newInstance
public static <T> AttributeKey<T> newInstance(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(Class<?> firstNameComponent, String secondNameComponent)
-
-