Package eu.bandm.tools.ops
Class HeteroMap
- All Implemented Interfaces:
Map<HeteroMap.Key,
Object>
Immutable map with heterogeneously typed entries.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K extends Object,
V extends Object>, AbstractMap.SimpleImmutableEntry<K extends Object, V extends Object> -
Method Summary
Modifier and TypeMethodDescriptionstatic HeteroMap
empty()
Returns an empty map.entrySet()
<V> V
get
(HeteroMap.Key<V> key) Returns the value to which the specified key is mapped, ornull
if this map contains no mapping for the key.<V> HeteroMap
with
(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, values
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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, ornull
if 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
null
if this map contains no mapping for the key
-
entrySet
- Specified by:
entrySet
in interfaceMap<HeteroMap.Key,
Object> - Specified by:
entrySet
in 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:
-