K
- the type of the Map entry keyV
- the type of the Map entry valuepublic static interface InvocableMap.Entry<K,V> extends QueryMap.Entry<K,V>
Modifier and Type | Method and Description |
---|---|
K |
getKey()
Return the key corresponding to this entry.
|
V |
getValue()
Return the value corresponding to this entry.
|
default V |
getValue(V defaultValue)
Return the value corresponding to this entry, or the specified
defaultValue , if the entry value is null . |
boolean |
isPresent()
Determine if this Entry exists in the Map.
|
boolean |
isSynthetic()
Determine if this Entry has been synthetically mutated.
|
void |
remove(boolean fSynthetic)
Remove this Entry from the Map if it is present in the Map.
|
V |
setValue(V value)
Store the value corresponding to this entry.
|
void |
setValue(V value,
boolean fSynthetic)
Store the value corresponding to this entry.
|
<T> void |
update(ValueUpdater<V,T> updater,
T value)
Update the Entry's value.
|
extract, extractFromKey, extractFromValue
comparingByKey, comparingByKey, comparingByValue, comparingByValue, equals, hashCode
K getKey()
isPresent()
, and to create the entry for the key, use setValue(V)
.V getValue()
isPresent()
.
Note: any modifications to the value retrieved using this
method are not guaranteed to persist unless followed by a setValue(V)
or update(com.tangosol.util.ValueUpdater<V, T>, T)
call.
V setValue(V value)
default V getValue(V defaultValue)
defaultValue
, if the entry value is null
.
To differentiate between a null value and a non-existent entry,
use isPresent()
.
Note: any modifications to the value retrieved using this
method are not guaranteed to persist unless followed by a setValue(V)
or update(com.tangosol.util.ValueUpdater<V, T>, T)
call.
defaultValue
- the default value to return if the entry
value is null
defaultValue
, if the entry value is null
void setValue(V value, boolean fSynthetic)
Unlike the other form of setValue
, this
form does not return the previous value, and as a result may be
significantly less expensive (in terms of cost of execution) for
certain Map implementations.
value
- the new value for this EntryfSynthetic
- pass true only if the insertion into or
modification of the Map should be treated as a
synthetic event<T> void update(ValueUpdater<V,T> updater, T value)
V target = entry.getValue(); updater.update(target, value); entry.setValue(target, false);The benefit of using this method is that it may allow the Entry implementation to significantly optimize the operation, such as for purposes of delta updates and backup maintenance.
T
- the class of the valueupdater
- a ValueUpdater used to modify the Entry's valuevalue
- the new value for this Entryboolean isPresent()
setValue(Object)
or
setValue(Object, boolean)
. If the Entry is present, it can
be destroyed by calling remove(boolean)
.boolean isSynthetic()
false
if either a non-synthetic update was made or
the entry has not been modified.void remove(boolean fSynthetic)
This method supports both the operation corresponding to Map.remove(java.lang.Object)
as well as synthetic operations such as eviction. If the
containing Map does not differentiate between the two, then this
method will always be identical to InvocableMap.this.remove(getKey()).
fSynthetic
- pass true only if the removal from the Map should
be treated as a synthetic event