public interface BinaryEntry<K,V> extends InvocableMap.Entry<K,V>
Modifier and Type | Method and Description |
---|---|
void |
expire(long cMillis)
Update the entry with the specified expiry delay.
|
ObservableMap<K,V> |
getBackingMap()
Deprecated.
As of Coherence 12.1.3, replaced with
BackingMapContext.getBackingMapEntry(java.lang.Object)
BackingMapContext.getBackingMapEntry(java.lang.Object) |
BackingMapContext |
getBackingMapContext()
Obtain a reference to the
backing map context
for the cache that this Entry corresponds to. |
Binary |
getBinaryKey()
Return a raw binary key for this entry.
|
Binary |
getBinaryValue()
Return a raw binary value for this entry.
|
BackingMapManagerContext |
getContext()
Return the context this entry operates within.
|
long |
getExpiry()
Return the number of milliseconds remaining before the specified entry
is scheduled to expire.
|
Binary |
getOriginalBinaryValue()
Return a raw original binary value for this entry.
|
V |
getOriginalValue()
Return an original value for this entry.
|
Serializer |
getSerializer()
Return a
Serializer that is used to serialize/deserialize this
entry. |
boolean |
isReadOnly()
Check whether this BinaryEntry allows data modification operations.
|
default boolean |
isValueChanged()
Check whether the value of this BinaryEntry is changed.
|
default boolean |
isValueLoaded()
Check whether this BinaryEntry is loaded by a "read-through" operation.
|
default boolean |
isValueRemoved()
Check whether the value of this BinaryEntry is removed.
|
default boolean |
isValueUpdated()
Check whether the value of this BinaryEntry is updated.
|
void |
remove(boolean fSynthetic)
Remove this Entry from the Map if it is present in the Map.
|
void |
setValue(V value,
boolean fSynthetic)
Store the value corresponding to this entry.
|
void |
updateBinaryValue(Binary binValue)
Update the binary value for this entry.
|
void |
updateBinaryValue(Binary binValue,
boolean fSynthetic)
Update the binary value for this entry.
|
getKey, getValue, getValue, isPresent, isSynthetic, setValue, update
extract, extractFromKey, extractFromValue
comparingByKey, comparingByKey, comparingByValue, comparingByValue, equals, hashCode
Binary getBinaryKey()
Binary getBinaryValue()
Serializer getSerializer()
Serializer
that is used to serialize/deserialize this
entry.Serializer
that is used to serialize/deserialize this
entryBackingMapManagerContext getContext()
Note: This method is a shortcut for the getBackingMapContext.getManagerContext()
call.
void updateBinaryValue(Binary binValue)
Passing a non-null binary is functionally equivalent to:
setValue(getContext().getValueFromInternalConverter().convert(binValue));Passing null value is functionally equivalent to removing the entry.
remove(false);
binValue
- new binary value to be stored in this entry or nullvoid updateBinaryValue(Binary binValue, boolean fSynthetic)
Passing a non-null binary is functionally equivalent to:
setValue(getContext().getValueFromInternalConverter().convert(binValue));Passing null value is functionally equivalent to removing the entry.
remove(false);This method will bypass any
CacheStore
or
BinaryEntryStore
implementations, iff fSynthetic is true and the
backing map associated with this entry is a ReadWriteBackingMap.binValue
- new binary value to be stored in this entry or nullfSynthetic
- pass true only if the insertion into or
modification of the Map should be treated as a
synthetic eventV getOriginalValue()
Binary getOriginalBinaryValue()
ObservableMap<K,V> getBackingMap()
BackingMapContext.getBackingMapEntry(java.lang.Object)
BackingMapContext.getBackingMapEntry(java.lang.Object)
Note: This method is a shortcut for the getBackingMapContext().getBackingMap()
call. As of Coherence 3.7, the returned type has been narrowed to
ObservableMap.
BackingMapContext getBackingMapContext()
backing map context
for the cache that this Entry corresponds to.void expire(long cMillis)
Note: this method only has an effect only if the associated backing map
implements the CacheMap
interface
cMillis
- the number of milliseconds until the entry will expire;
pass CacheMap.EXPIRY_DEFAULT
to use the default expiry setting;
pass CacheMap.EXPIRY_NEVER
to indicate that the entry should
never expirelong getExpiry()
expire(long)
method has been called,
the returned value will reflect the requested expiry delay. Otherwise if
the entry exists
, the returned value will represent
the time remaining until the entry expires (or CacheMap.EXPIRY_NEVER
if the
entry will never expire). If the entry does not exist, CacheMap.EXPIRY_DEFAULT
will be returned.
This method will make a "best effort" attempt to determine the
expiry time remaining. In some cases, it may not be possible to determine
the expiry (e.g. the backing-map does not implement the CacheMap
interface), in which case
CacheMap.EXPIRY_DEFAULT
will be returned.
boolean isReadOnly()
default boolean isValueLoaded()
default boolean isValueChanged()
default boolean isValueUpdated()
default boolean isValueRemoved()
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.
As of Coherence 12.1.2, if fSynthetic is true and the
BackingMap
associated with this entry is a
ReadWriteBackingMap, this method will bypass the
CacheStore
or
BinaryEntryStore
.
setValue
in interface InvocableMap.Entry<K,V>
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 eventvoid 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()).
As of Coherence 12.1.2, if fSynthetic is true and the
BackingMap
associated with this entry is a
ReadWriteBackingMap, this method will bypass the
CacheStore
or
BinaryEntryStore
.
remove
in interface InvocableMap.Entry<K,V>
fSynthetic
- pass true only if the removal from the Map should
be treated as a synthetic event