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 map
R - the key type of this map
V - the value type
All Implemented Interfaces:
ConcurrentMap<R,V>, Map<R,V>

public class KeyMapperMap<K,R,V> extends AbstractMap<R,V> implements ConcurrentMap<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.