org.gatein.mop.api
Class Key<T>

java.lang.Object
  extended by org.gatein.mop.api.Key<T>

public class Key<T>
extends Object

A key is a typed name. This class is immutable and is therefore thread safe.

Version:
$Revision$
Author:
Julien Viet

Constructor Summary
protected Key(String name, ValueType<T> type)
          Creates a new key.
 
Method Summary
static
<T> Key<T>
create(String name, ValueType<T> type)
           
 boolean equals(Object obj)
           
 String getName()
          Returns the key name.
 ValueType<T> getType()
          Returns the key type.
 int hashCode()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Key

protected Key(String name,
              ValueType<T> type)
       throws NullPointerException
Creates a new key.

Parameters:
name - the key name
type - the key type
Throws:
NullPointerException - if the name is null
Method Detail

create

public static <T> Key<T> create(String name,
                                ValueType<T> type)

getType

public ValueType<T> getType()
Returns the key type.

Returns:
the type

getName

public final String getName()
Returns the key name.

Returns:
the name

hashCode

public int hashCode()
Overrides:
hashCode in class Object

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

toString

public String toString()
Overrides:
toString in class Object


Copyright © 2009 eXo Platform SAS. All Rights Reserved.