K - the key typeV - the value typepublic interface Cache<K,V> extends CacheProvider<K,V>, Serializable
Cache interface provides set of methods for different cache
implementations, such as MemoryCache or SyncMemoryCache, etc.
Example of using cache object:
destination.getCache().get(CURRENT_KEY);
| Modifier and Type | Method and Description |
|---|---|
void |
clear()
Clears the cache.
|
void |
clearByKey(K key)
Removes cache entry by key.
|
void |
clearByValue(V value)
Removes cache entry by value.
|
V |
get(K key)
Gets the object stored in the cache by key.
|
V |
put(K key,
V value)
Puts the object into the cache.
|
int |
size()
Returns size of the cache.
|
getCachevoid clear()
void clearByKey(K key)
key - the keyvoid clearByValue(V value)
value - the valueV get(K key)
key - the keyV put(K key, V value)
key - the keyvalue - the valueint size()
Copyright © 2010-2020 Toolsverse. All Rights Reserved.