public class Key<T>
extends java.lang.Object
KeyWithDefaultValue
Constructor and Description |
---|
Key(java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
static <T> Key<T> |
create(java.lang.String name) |
boolean |
equals(java.lang.Object obj) |
static Key<?> |
findKeyByName(java.lang.String name)
Deprecated.
access to a key via its name is a dirty hack; use Key instance directly instead
|
T |
get(java.util.Map<Key,?> holder) |
T |
get(UserDataHolder holder) |
T |
get(UserDataHolder holder,
T defaultValue) |
static <T> Key<T> |
getKeyByIndex(int index) |
T |
getRequired(UserDataHolder holder) |
int |
hashCode() |
boolean |
isIn(UserDataHolder holder)
Returns
true if and only if the holder has not null value for the key. |
void |
set(java.util.Map<Key,java.lang.Object> holder,
T value) |
void |
set(UserDataHolder holder,
T value) |
java.lang.String |
toString() |
public final int hashCode()
hashCode
in class java.lang.Object
public final boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object
public static <T> Key<T> create(java.lang.String name)
public T get(UserDataHolder holder)
public T get(UserDataHolder holder, T defaultValue)
public T getRequired(UserDataHolder holder)
public boolean isIn(UserDataHolder holder)
true
if and only if the holder
has not null value for the key.public void set(UserDataHolder holder, T value)
public static <T> Key<T> getKeyByIndex(int index)
@Deprecated public static Key<?> findKeyByName(java.lang.String name)