org.apache.mina.session

## Class AttributeKey<T>

- java.lang.Object
- - org.apache.mina.session.AttributeKey<T>

Type Parameters:
  `T` - Type of the attribute-value this key is referring to

    public final class AttributeKey<T>
    extends Object

Represents the Key for an attribute-value of an `IoSession`. A key consists of the Type of the referenced attribute value and a name.
Two `AttributeKey`'s are equal if the have the same attribute-type and attribute-name.

Author:
  Apache MINA Project

### Constructor Summary

Constructors
Constructor and Description
`AttributeKey(Class<T> attributeType, String attributeName)` Creates a new `AttributeKey` with the given parameters.

### Method Summary

Methods
`static <T> AttributeKey<T>` `createKey(Class<T> attributeType, String attributeName)` Creates a new `AttributeKey` with the given parameters.
`boolean` `equals(Object obj)`
`String` `getName()` Returns the name of this key.
`Class<T>` `getType()` Returns the type of this key.
`int` `hashCode()`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### AttributeKey

    public AttributeKey(Class<T> attributeType,
                String attributeName)

Creates a new `AttributeKey` with the given parameters. A `IllegalArgumentException` will be thrown if any parameter is `null`.

Parameters:
  `attributeType` - type of the referenced attribute-value, must not be `null`
  `attributeName` - name of this key, must not be `null`
Throws:
  `IllegalArgumentException` - if any parameter is `null`
See Also:
  `createKey(Class, String)`

### Method Detail

#### createKey

    public static <T> AttributeKey<T> createKey(Class<T> attributeType,
                                String attributeName)

Creates a new `AttributeKey` with the given parameters. A `IllegalArgumentException` will be thrown if any parameter is `null`.
This call is equal to `AttributeKey(Class, String)`

Parameters:
  `attributeType` - type of the referenced attribute-value, must not be `null`
  `attributeName` - name of this key, must not be `null`
Throws:
  `IllegalArgumentException` - if any parameter is `null`
See Also:
  `AttributeKey(Class, String)`

#### getName

    public String getName()

Returns the name of this key.

Returns:
  name of this key, never `null`

#### getType

    public Class<T> getType()

Returns the type of this key.

Returns:
  type of this key, never `null`

#### hashCode

    public int hashCode()

Overrides:
  `hashCode` in class `Object`

#### equals

    public boolean equals(Object obj)

Overrides:
  `equals` in class `Object`