Class CacheMap
java.lang.Object
java.util.AbstractMap<ICacheKey<?>, List<ICacheValue<?>>>
java.util.concurrent.ConcurrentHashMap<ICacheKey<?>, List<ICacheValue<?>>>
org.tavall.couriers.api.cache.maps.CacheMap
- All Implemented Interfaces:
Serializable, ConcurrentMap<ICacheKey<?>, List<ICacheValue<?>>>, Map<ICacheKey<?>, List<ICacheValue<?>>>
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class ConcurrentHashMap
ConcurrentHashMap.KeySetView<K,V> Nested classes/interfaces inherited from class AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidadd(ICacheKey<?> cacheKey, ICacheValue<?> newValue) booleancontainsDomainKey(ICacheKey<?> key) booleancontainsInBucket(Class<?> domainKey, ICacheValue<?> value) booleancontainsPayload(ICacheKey<?> key, Object realPayload) Checks if the REAL domain object (payload) already exists in the bucket.List<List<ICacheValue<?>>> findByDomain(CacheDomain domain) List<List<ICacheValue<?>>> findByType(CacheType type) List<ICacheValue<?>> static CacheMapvoidremoveCacheKey(ICacheKey<?> key) Hard delete of the Key (and its entire bucket).voidremoveValue(ICacheValue<?> valueToRemove) Removes a specific Wrapper value from the bucket, but keeps the Key.<T> Tunwrap(ICacheValue<?> wrapper, Class<T> type) Type-Safe Extraction helper.Methods inherited from class 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
-
Field Details
-
INSTANCE
-
-
Constructor Details
-
CacheMap
public CacheMap()
-
-
Method Details
-
getCacheMap
-
add
-
getBucket
-
unwrap
Type-Safe Extraction helper. You pass the Wrapper you got, and the Class you expect inside it. We handle the ugly casting here so your service code stays clean. -
containsInBucket
-
removeValue
Removes a specific Wrapper value from the bucket, but keeps the Key. This supports your "Key persists, Value eliminated" logic. -
removeCacheKey
Hard delete of the Key (and its entire bucket). -
containsDomainKey
-
containsPayload
-
findByDomain
-
findByType
-