Class AttributeKey<T>

java.lang.Object
io.netty.util.AbstractConstant<AttributeKey<T>>
io.netty.util.AttributeKey<T>
Type Parameters:
T - the type of the Attribute which can be accessed via this AttributeKey.
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 access Attribute out of the AttributeMap. Be aware that it is not be possible to have multiple keys with the same name.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    private static final ConstantPool<AttributeKey<java.lang.Object>>
     
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    private
    AttributeKey(int id, java.lang.String name)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static boolean
    exists(java.lang.String name)
    Returns true if a AttributeKey exists for the given name.
    static <T> AttributeKey<T>
    newInstance(java.lang.String name)
    Creates a new AttributeKey for the given name or fail with an IllegalArgumentException if a AttributeKey for the given name 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 the AttributeKey which has the specified name.

    Methods inherited from class AbstractConstant

    compareTo, equals, hashCode, id, name, toString

    Methods inherited from class java.lang.Object

    clone, finalize, getClass, notify, notifyAll, wait, wait, wait
  • Field Details

  • Constructor Details

    • AttributeKey

      private AttributeKey(int id, java.lang.String name)
  • Method Details

    • valueOf

      public static <T> AttributeKey<T> valueOf(java.lang.String name)
      Returns the singleton instance of the AttributeKey which has the specified name.
    • exists

      public static boolean exists(java.lang.String name)
      Returns true if a AttributeKey exists for the given name.
    • newInstance

      public static <T> AttributeKey<T> newInstance(java.lang.String name)
      Creates a new AttributeKey for the given name or fail with an IllegalArgumentException if a AttributeKey for the given name exists.
    • valueOf

      public static <T> AttributeKey<T> valueOf(java.lang.Class<?> firstNameComponent, java.lang.String secondNameComponent)