Top Description Methods
javax.cache.processor

public Interface MutableEntry<K, V>

extends Cache.Entry<K, V>
Type Parameters
<K>
the type of key
<V>
the type of value
Imports
javax.cache.Cache, javax.cache.integration.CacheLoader

A mutable representation of a javax.cache.Cache.Entry.

Mutable entries are used by EntryProcessors to mutate Cache.Entrys in place, atomically.

Author
Greg Luck
Since
1.0
See Also
EntryProcessor

Method Summary

Modifier and TypeMethod and Description
public boolean

Returns:

true if the entry exists
exists
()

Checks for the existence of the entry in the cache

public V

Returns:

the value corresponding to this entry
getValue
()

Redeclares javax.cache.Cache.Entry.getValue.

Returns the value stored in the cache.
public void
remove()

Removes the entry from the Cache.

public void
setValue(V
the value to update the entry with
value
)

Sets or replaces the value associated with the key.

Inherited from javax.cache.Cache.Entry:
getKeyunwrap

Method Detail

existsback to summary
public boolean exists()

Checks for the existence of the entry in the cache

Returns:boolean

true if the entry exists

getValueback to summary
public V getValue()

Redeclares javax.cache.Cache.Entry.getValue.

Returns the value stored in the cache.

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.

Returns:V

the value corresponding to this entry

removeback to summary
public void remove()

Removes the entry from the Cache.

This has the same semantics as calling Cache#remove.

setValueback to summary
public void setValue(V value)

Sets or replaces the value associated with the key.

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.

Parameters
value:V

the value to update the entry with

Exceptions
ClassCastException:
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