Class KeyMapperMap<K,R,V>
java.lang.Object
java.util.AbstractMap<R,V>
org.infinispan.commons.util.KeyMapperMap<K,R,V>
- Type Parameters:
K- the key type of the delegate mapR- the key type of this mapV- the value type
- All Implemented Interfaces:
ConcurrentMap<R,V>, Map<R, V>
A ConcurrentMap that wraps another ConcurrentMap, converting the key type on the fly. This Map requires both
key mapping and unmapping which allows for it to support both and read operations for all of its direct methods.
This Map, however, does not support insertions into its
keySet() or AbstractMap.values() collections as they
are read only!
This class currently only accepts Functions that also implements InjectiveFunction so that they can
guarantee the resulting mapped values are distinct from each other. This is important as many operations become
very costly if this is not true.
-
Nested Class Summary
Nested classes/interfaces inherited from class AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclear()computeIfAbsent(R key, Function<? super R, ? extends V> mappingFunction) computeIfPresent(R key, BiFunction<? super R, ? super V, ? extends V> remappingFunction) booleancontainsKey(Object key) entrySet()keySet()voidputIfAbsent(R key, V value) booleanbooleanvoidreplaceAll(BiFunction<? super R, ? super V, ? extends V> function) Methods inherited from class AbstractMap
clone, containsValue, equals, hashCode, isEmpty, size, toString, valuesMethods inherited from interface ConcurrentMap
forEach, getOrDefault
-
Constructor Details
-
KeyMapperMap
-
-
Method Details
-
get
-
put
-
remove
-
containsKey
- Specified by:
containsKeyin interfaceMap<K,R> - Overrides:
containsKeyin classAbstractMap<R,V>
-
putIfAbsent
- Specified by:
putIfAbsentin interfaceConcurrentMap<K,R> - Specified by:
putIfAbsentin interfaceMap<K,R>
-
remove
-
replace
-
replace
-
entrySet
-
putAll
-
replaceAll
- Specified by:
replaceAllin interfaceConcurrentMap<K,R> - Specified by:
replaceAllin interfaceMap<K,R>
-
computeIfAbsent
- Specified by:
computeIfAbsentin interfaceConcurrentMap<K,R> - Specified by:
computeIfAbsentin interfaceMap<K,R>
-
computeIfPresent
- Specified by:
computeIfPresentin interfaceConcurrentMap<K,R> - Specified by:
computeIfPresentin interfaceMap<K,R>
-
compute
-
merge
-
keySet
-
clear
-