K
- the type of keyV
- the type of valueCache.Entry<K,V>
public interface MutableEntry<K,V> extends Cache.Entry<K,V>
Cache.Entry
.
Mutable entries are used by EntryProcessor
s to mutate
Cache.Entry
s in place, atomically.
EntryProcessor
Modifier and Type | Method | Description |
---|---|---|
boolean |
exists() |
Checks for the existence of the entry in the cache
|
V |
getValue() |
Returns the value stored in the cache.
|
void |
remove() |
Removes the entry from the Cache.
|
void |
setValue(V value) |
Sets or replaces the value associated with the key.
|
getKey, unwrap
boolean exists()
void remove()
This has the same semantics as calling Cache.remove(K)
.
V getValue()
If the cache is configured to use read-through, and this method
would return null because the entry is missing from the cache,
the Cache's CacheLoader
is called in an attempt to load
the entry.
getValue
in interface Cache.Entry<K,V>
void setValue(V value)
If exists()
is false and setValue is called
then a mapping is added to the cache visible once the EntryProcessor
completes. Moreover a second invocation of exists()
will return true.
value
- the value to update the entry withClassCastException
- if the implementation supports and is
configured to perform runtime-type-checking,
and value type is incompatible with that
which has been configured for the
Cache
Copyright © 2017. All rights reserved.