K - key typeV - result typepublic class MapEntryUpdateResult<K,V> extends Object
Both old and new values are accessible along with a flag that indicates if the the value was updated. If flag is false, oldValue and newValue both point to the same unmodified value.
| Modifier and Type | Class and Description |
|---|---|
static class |
MapEntryUpdateResult.Status |
| Constructor and Description |
|---|
MapEntryUpdateResult(MapEntryUpdateResult.Status status,
String mapName,
K key,
Versioned<V> oldValue,
Versioned<V> newValue) |
| Modifier and Type | Method and Description |
|---|---|
K |
key()
Returns the map key.
|
<K1,V1> MapEntryUpdateResult<K1,V1> |
map(Function<K,K1> keyTransform,
Function<V,V1> valueMapper)
Maps to another instance with different key and value types.
|
String |
mapName()
Returns the map name.
|
Versioned<V> |
newValue()
Returns the new value after update.
|
Versioned<V> |
oldValue()
Returns the old value.
|
MapEntryUpdateResult.Status |
status()
Returns the update status.
|
MapEvent<K,V> |
toMapEvent()
Return the map event that will be generated as a result of this update.
|
String |
toString() |
boolean |
updated()
Returns
true if the update was successful. |
public boolean updated()
true if the update was successful.true if yes, false otherwisepublic String mapName()
public MapEntryUpdateResult.Status status()
public K key()
public Versioned<V> oldValue()
public Versioned<V> newValue()
public <K1,V1> MapEntryUpdateResult<K1,V1> map(Function<K,K1> keyTransform, Function<V,V1> valueMapper)
K1 - key type of returned MapEntryUpdateResultV1 - value type of returned MapEntryUpdateResultkeyTransform - transformer to use for transcoding keysvalueMapper - mapper to use for transcoding valuespublic MapEvent<K,V> toMapEvent()
null