K
- Key class typepublic class AnyMap<K> extends HashMap<K,Object>
HashMap
for multiple object types that
offers a type checked get(Object, Class)
method.AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID
Serial version.
|
Constructor and Description |
---|
AnyMap()
Constructor
|
Modifier and Type | Method and Description |
---|---|
<T> T |
get(K key,
Class<T> restriction)
Type checked get method
|
Object |
get(Object key)
Deprecated.
use
get(Object, Class) or
getGenerics(Object, Class) instead, for type safety! |
<T> T |
getGenerics(K key,
Class<?> restriction)
(Largely) type checked get method for use with generic types
|
clear, clone, containsKey, containsValue, entrySet, isEmpty, keySet, put, putAll, remove, size, values
equals, hashCode, toString
private static final long serialVersionUID
public <T> T get(K key, Class<T> restriction)
T
- Return typekey
- Keyrestriction
- restriction classpublic <T> T getGenerics(K key, Class<?> restriction)
T
- Return typekey
- Keyrestriction
- restriction class