Cache.EntryListener, Cache.EntryListenerAdapter| Modifier and Type | Field and Description |
|---|---|
static NoCache |
INSTANCE
Creates a singleton reference the the NoCache implementation.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
containsKey(Object key)
Indicates whether there is an item stored under given
key. |
<K,V> V |
get(K key)
Returns an item from the cache, or
null if no item was stored under that key |
void |
put(Object key,
Object value)
Stores the given
value in the cache, under given key. |
boolean |
putIfAbsent(Object key,
Object value)
Stores the given
value in the cache, under given key, if no element is yet available under that
key. |
Registration |
registerCacheEntryListener(Cache.EntryListener cacheEntryListener)
Registers the given
cacheEntryListener to listen for Cache changes. |
boolean |
remove(Object key)
Removes the entry stored under given
key. |
public static final NoCache INSTANCE
public <K,V> V get(K key)
Cachenull if no item was stored under that keypublic void put(Object key, Object value)
Cachevalue in the cache, under given key. If an item already exists, it is updated
with the new value.public boolean putIfAbsent(Object key, Object value)
Cachevalue in the cache, under given key, if no element is yet available under that
key. This operation is performed atomically.putIfAbsent in interface Cachekey - The key under which to store the itemvalue - The item to cachetrue if no value was previously assigned to the key, false otherwise.public boolean remove(Object key)
Cachekey. If no such entry exists, nothing happens.public boolean containsKey(Object key)
Cachekey.containsKey in interface Cachekey - The key to checktrue if an item is available under that key, false otherwise.public Registration registerCacheEntryListener(Cache.EntryListener cacheEntryListener)
CachecacheEntryListener to listen for Cache changes.registerCacheEntryListener in interface CachecacheEntryListener - The listener to registerCopyright © 2010–2020. All rights reserved.