Package com.atlassian.bamboo.utils.map
Class Key<T>
- java.lang.Object
-
- com.atlassian.bamboo.utils.map.Key<T>
-
- Type Parameters:
T
-
public final class Key<T> extends Object
Allows type safe retrieval of a value fromTypedIdentityMap
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description <V> V
cast(Object value)
Casts the given object togetValueClass()
static <T> Key<T>
createKey(Class<T> clazz)
Creates a new Key typed by the givenClass
Class<? extends T>
getValueClass()
Gets theClass
type used for the Value stored against this keyString
toString()
-
-
-
Method Detail
-
createKey
public static <T> Key<T> createKey(Class<T> clazz)
Creates a new Key typed by the givenClass
- Type Parameters:
T
-- Parameters:
clazz
- type of the value- Returns:
- key
-
getValueClass
public Class<? extends T> getValueClass()
Gets theClass
type used for the Value stored against this key- Returns:
- valueClass
-
cast
public <V> V cast(Object value)
Casts the given object togetValueClass()
- Type Parameters:
V
-- Parameters:
value
-- Returns:
- casted value
-
-