public final class MetaData extends ConcurrentHashMap<String,Object> implements Cloneable
ConcurrentHashMap.KeySetView<K,V>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
MetaData() |
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Returns a shallow copy of this
MetaData instance: the keys and values themselves are not cloned.
|
<T> T |
get(Class<T> type, String key)
Returns the value to which the specified key is mapped, or
null if this map contains no mapping for the key.
|
<T> Optional<T> |
getOptional(Class<T> type, String key)
Optionaly returns the value to which the specified key is mapped.
|
clear, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, forEach, forEach, forEachEntry, forEachEntry, forEachKey, forEachKey, forEachValue, forEachValue, get, getOrDefault, hashCode, isEmpty, keys, keySet, keySet, mappingCount, merge, newKeySet, newKeySet, put, putAll, putIfAbsent, reduce, reduceEntries, reduceEntries, reduceEntriesToDouble, reduceEntriesToInt, reduceEntriesToLong, reduceKeys, reduceKeys, reduceKeysToDouble, reduceKeysToInt, reduceKeysToLong, reduceToDouble, reduceToInt, reduceToLong, reduceValues, reduceValues, reduceValuesToDouble, reduceValuesToInt, reduceValuesToLong, remove, remove, replace, replace, replaceAll, search, searchEntries, searchKeys, searchValues, size, toString, values
public <T> T get(Class<T> type, String key)
null
if this map contains no mapping for the key.
More formally, if this map contains a mapping from a key k
to a value v
such that (key==null ? k==null : key.equals(k))
, then this method returns v
; otherwise it returns null
. (There can be at most one such mapping.)
A return value of null
does not necessarily indicate that the map contains no mapping for the key; it's also possible that the map explicitly maps the key to null
. The containsKey
operation may be used to distinguish these two cases.
T
- Parameterized meta-data type
type
- Requested meta-data type
key
- Key
null
if this map contains no mapping for the key.
ClassCastException
- if the MetaData at the given key is not assignable to the given type.
public <T> Optional<T> getOptional(Class<T> type, String key)
T
- Parameterized meta-data type
type
- Requested meta-data type
key
- Key
ClassCastException
- if the MetaData at the given key is not assignable to the given type.
public Object clone()
clone
in class
AbstractMap<String,Object>