T - type of the classpublic class ClassMap<T> extends HashMap<ClassDescriptor,T>
ClassMap differs from typical maps
in that it takes subclasses into account; mapping a class to a value also maps all subclasses of
that class to the value.
A get operation will return the value associated with the class itself, or failing
that, with its nearest ancestor for which there exists a mapping.AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>| Modifier and Type | Field and Description |
|---|---|
protected static org.apache.logging.log4j.Logger |
log
Logger
|
| Constructor and Description |
|---|
ClassMap() |
| Modifier and Type | Method and Description |
|---|---|
T |
get(Object key)
Returns the value associated with the key
Class. |
T |
put(ClassDescriptor key,
T value)
Associates a value with a class and all of its descendents.
|
clear, clone, compute, computeIfAbsent, computeIfPresent, containsKey, containsValue, entrySet, forEach, getOrDefault, isEmpty, keySet, merge, putAll, putIfAbsent, remove, remove, replace, replace, replaceAll, size, valuesequals, hashCode, toStringpublic T get(Object key)
Class. If the class itself does not have
a mapping, its superclass will be checked, and so on until an ancestor class with a mapping is
located. If none of the class' ancestors have a mapping, null is returned.get in interface Map<ClassDescriptor,T>get in class HashMap<ClassDescriptor,T>key - the class to checkpublic T put(ClassDescriptor key, T value)
put in interface Map<ClassDescriptor,T>put in class HashMap<ClassDescriptor,T>key - the class to mapvalue - the value to map to the classCopyright © 2008–2019 Ultreia.io. All rights reserved.