Class SimpleMapEvent<K,V>
java.lang.Object
com.tangosol.coherence.rest.events.SimpleMapEvent<K,V>
Simple representation of
MapEvent
that can be marshalled to JSON.- Author:
- as 2015.06.26
-
Constructor Summary
ConstructorDescriptionDeserialization constructor.SimpleMapEvent
(MapEvent<? extends K, ? extends V> evt) Construct SimpleMapEvent instance. -
Method Summary
Modifier and TypeMethodDescriptiongetCache()
Return the cache name.getKey()
Return the key associated with this event.Return the new value associated with this event.Return the old value associated with this event.int
getType()
Return the event type.void
Set the cache name.void
Set the key for this event.void
setNewValue
(V newValue) Set the new value.void
setOldValue
(V oldValue) Set the old value.void
setType
(int nType) Set the event type.toString()
-
Constructor Details
-
SimpleMapEvent
public SimpleMapEvent()Deserialization constructor. -
SimpleMapEvent
Construct SimpleMapEvent instance.- Parameters:
evt
- the MapEvent to construct this instance from
-
-
Method Details
-
getCache
Return the cache name.- Returns:
- the cache name
-
setCache
Set the cache name.- Parameters:
sCache
- the cache name
-
getType
public int getType()Return the event type.The value is one of:
- INSERTED
- UPDATED
- DELETED
Unlike SSE event name, which is calculated for update operations when filter-based listeners are used, this attribute always represents the actual operation that occured on the underlying cache.
- Returns:
- the event type
-
setType
public void setType(int nType) Set the event type.- Parameters:
nType
- the event type
-
getKey
Return the key associated with this event.- Returns:
- the key
-
setKey
Set the key for this event.- Parameters:
key
- the key
-
getOldValue
Return the old value associated with this event.The old value represents a value deleted from or updated in a map. It is always null for "insert" notifications.
- Returns:
- the old value
-
setOldValue
Set the old value.- Parameters:
oldValue
- the old value
-
getNewValue
Return the new value associated with this event.The new value represents a new value inserted into or updated in a map. It is always null for "delete" notifications.
- Returns:
- the new value
-
setNewValue
Set the new value.- Parameters:
newValue
- the new value
-
toString
-