Package org.apache.juneau.internal
Class TwoKeyConcurrentCache<K1,K2,V>
java.lang.Object
java.util.AbstractMap<K,V>
java.util.concurrent.ConcurrentHashMap<org.apache.juneau.internal.TwoKeyConcurrentCache.Key<K1,K2>,V>
org.apache.juneau.internal.TwoKeyConcurrentCache<K1,K2,V>
- Type Parameters:
K1
- Key part 1 type.K2
- Key part 2 type.V
- Value type.
- All Implemented Interfaces:
Serializable
,ConcurrentMap<org.apache.juneau.internal.TwoKeyConcurrentCache.Key<K1,
,K2>, V> Map<org.apache.juneau.internal.TwoKeyConcurrentCache.Key<K1,
K2>, V>
public class TwoKeyConcurrentCache<K1,K2,V>
extends ConcurrentHashMap<org.apache.juneau.internal.TwoKeyConcurrentCache.Key<K1,K2>,V>
A hashmap that allows for two-part keys.
See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.concurrent.ConcurrentHashMap
ConcurrentHashMap.KeySetView<K extends Object,
V extends Object> 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> -
Constructor Summary
ConstructorDescriptionConstructor.TwoKeyConcurrentCache
(boolean disabled, BiFunction<K1, K2, V> supplier) Constructor. -
Method Summary
Methods inherited from class java.util.concurrent.ConcurrentHashMap
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
Methods inherited from class java.util.AbstractMap
clone
-
Constructor Details
-
TwoKeyConcurrentCache
public TwoKeyConcurrentCache()Constructor. -
TwoKeyConcurrentCache
Constructor.- Parameters:
disabled
- Iftrue , get/put operations are no-ops.supplier
- The supplier for this cache.
-
-
Method Details
-
put
Adds an entry to this map.- Parameters:
key1
- Key part 1. Can benull .key2
- Key part 2. Can benull .value
- Value.- Returns:
- The previous value if there was one.
-
get
Retrieves an entry from this map.- Parameters:
key1
- Key part 1. Can benull .key2
- Key part 2. Can benull .- Returns:
- The previous value if there was one.
-