Constructor and Description |
---|
CacheUtil() |
Modifier and Type | Method and Description |
---|---|
static <K extends Serializable,V,C extends Collection<V> & Serializable> |
addValueToMultiValuedCache(Cache<K,C> cache,
K key,
V element,
Supplier<C> supplier)
Adds the specified element to a cache, in a collection that is mapped by the provided key.
|
static <K extends Serializable,V extends Serializable> |
removeValueFromCache(Cache<K,V> cache,
V element)
Removes all entries of a cache that map to the provided value.
|
static <K extends Serializable,V,C extends Collection<V> & Serializable> |
removeValueFromMultiValuedCache(Cache<K,C> cache,
K key,
V element)
Removes all instances of the specified element from the collection that is mapped by the provided key.
|
static <K extends Serializable,V,C extends Collection<V> & Serializable> |
removeValueFromMultiValuedCache(Cache<K,C> cache,
V element)
Removes all instances of the specified element from every collection that is a value of the cache.
|
static <K extends Serializable,V extends Serializable> |
replaceValueInCache(Cache<K,V> cache,
V oldValue,
V newValue)
Replaces all instances of a particular value in a cache.
|
static <K extends Serializable,V extends Serializable> |
replaceValueInCacheByMapping(Cache<K,V> cache,
Function<V,V> mapper)
Applies a mapping function to all values in a cache.
|
static <K extends Serializable,V,C extends Collection<V> & Serializable> |
replaceValueInMultivaluedCache(Cache<K,C> cache,
V oldValue,
V newValue)
Replaces an element in a cache that has collection-based values.
|
static <K extends Serializable,V extends Serializable> |
retainValueInCache(Cache<K,V> cache,
V element)
Remove elements from every collection that is a value of the cache, except for the specified element.
|
static <K extends Serializable,V,C extends Collection<V> & Serializable> |
retainValueInMultiValuedCache(Cache<K,C> cache,
V element)
Remove elements from every collection that is a value of the cache, except for the specified element.
|
public static <K extends Serializable,V,C extends Collection<V> & Serializable> void addValueToMultiValuedCache(Cache<K,C> cache, K key, V element, Supplier<C> supplier)
K
- the type of key contained by the cacheV
- the type of value contained by the cacheC
- the type of collection contained by the cachecache
- The cache from which to remove the element (cannot be null).element
- The element to be added (can be null only if the value-Collection supports null values).key
- The cache entry identifier (cannot be null)supplier
- A provider of empty instances of the collection used as a value of the cache (in which elements are placed).public static <K extends Serializable,V extends Serializable> Set<K> removeValueFromCache(Cache<K,V> cache, V element)
K
- the type of key contained by the cacheV
- the type of value contained by the cachecache
- The cache from which to remove the element (cannot be null).element
- The element to be removed (can not be null ).public static <K extends Serializable,V,C extends Collection<V> & Serializable> void removeValueFromMultiValuedCache(Cache<K,C> cache, K key, V element)
K
- the type of key contained by the cacheV
- the type of value contained by the cacheC
- the type of collection contained by the cachecache
- The cache from which to remove the element (cannot be null).key
- The cache entry identifier (cannot be null)element
- The element to be removed (can be null only if the value-Collection supports null values).public static <K extends Serializable,V,C extends Collection<V> & Serializable> Map<Boolean,Map<K,C>> removeValueFromMultiValuedCache(Cache<K,C> cache, V element)
K
- the type of key contained by the cacheV
- the type of value contained by the cacheC
- the type of collection contained by the cachecache
- The cache from which to remove the element (cannot be null).element
- The element to be removed (can be null only if the value-Collection supports null values).public static <K extends Serializable,V,C extends Collection<V> & Serializable> Map<Boolean,Map<K,C>> retainValueInMultiValuedCache(Cache<K,C> cache, V element)
K
- the type of key contained by the cacheV
- the type of value contained by the cacheC
- the type of collection contained by the cachecache
- The cache in which to retain the element (cannot be null).element
- The element to be retained (can be null only if the value-Collection supports null values).public static <K extends Serializable,V extends Serializable> Set<K> retainValueInCache(Cache<K,V> cache, V element)
K
- the type of key contained by the cacheV
- the type of value contained by the cachecache
- The cache in which to retain the element (cannot be null).element
- The element to be retained (cannot be null).public static <K extends Serializable,V extends Serializable> void replaceValueInCache(Cache<K,V> cache, V oldValue, V newValue)
K
- the type of key contained by the cacheV
- the type of value contained by the cachecache
- The cache from which to remove the element (cannot be null).oldValue
- The element to be replaced (cannot be null).newValue
- The replacement element (cannot be null).public static <K extends Serializable,V extends Serializable> void replaceValueInCacheByMapping(Cache<K,V> cache, Function<V,V> mapper)
K
- the type of key contained by the cacheV
- the type of value contained by the cachecache
- The cache from which to remove the element (cannot be null).mapper
- The mapping function (cannot be null).public static <K extends Serializable,V,C extends Collection<V> & Serializable> void replaceValueInMultivaluedCache(Cache<K,C> cache, V oldValue, V newValue)
K
- the type of key contained by the cacheV
- the type of value contained by the cacheC
- the type of collection contained by the cachecache
- The cache from which to remove the element (cannot be null).oldValue
- The element to be replaced (can be null only if the value-Collection supports null values).newValue
- The replacement element (can be null only if the value-Collection supports null values).Copyright © 2003–2020 Ignite Realtime. All rights reserved.