Package eu.bandm.tools.ops
Class HeteroMap
- All Implemented Interfaces:
Map<HeteroMap.Key,Object>
Immutable map with heterogeneously typed entries.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Method Summary
Modifier and TypeMethodDescriptionstatic HeteroMapempty()Returns an empty map.entrySet()<V> Vget(HeteroMap.Key<V> key) Returns the value to which the specified key is mapped, ornullif this map contains no mapping for the key.<V> HeteroMapwith(HeteroMap.Key<V> key, V value) Returns a map that has the same mappings as this map, with one exception.Methods inherited from class java.util.AbstractMap
clear, clone, containsKey, containsValue, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, toString, valuesMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Method Details
-
get
Returns the value to which the specified key is mapped, ornullif this map contains no mapping for the key.- Type Parameters:
V- the type of the value- Parameters:
key- the key whose associated value is to be returned- Returns:
- the value to which the specified key is mapped, or
nullif this map contains no mapping for the key
-
entrySet
- Specified by:
entrySetin interfaceMap<HeteroMap.Key,Object> - Specified by:
entrySetin classAbstractMap<HeteroMap.Key,Object>
-
empty
Returns an empty map. -
with
Returns a map that has the same mappings as this map, with one exception.- Type Parameters:
V-- Parameters:
key-value-- Returns:
-