Package org.onosproject.store.service
Class MapEvent<K,V>
- java.lang.Object
-
- org.onosproject.store.service.MapEvent<K,V>
-
- Type Parameters:
K
- key typeV
- value type
public class MapEvent<K,V> extends Object
Representation of a ConsistentMap update notification.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MapEvent.Type
MapEvent type.
-
Constructor Summary
Constructors Constructor Description MapEvent(String name, K key, Versioned<V> currentValue, Versioned<V> previousValue)
Creates a new event object.MapEvent(MapEvent.Type type, String name, K key, Versioned<V> currentValue, Versioned<V> previousValue)
Creates a new event object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
int
hashCode()
K
key()
Returns the key this event concerns.String
name()
Returns the map name.Versioned<V>
newValue()
Returns the new value in the map associated with the key.Versioned<V>
oldValue()
Returns the value associated with the key, before it was updated.String
toString()
MapEvent.Type
type()
Returns the type of the event.
-
-
-
Constructor Detail
-
MapEvent
public MapEvent(String name, K key, Versioned<V> currentValue, Versioned<V> previousValue)
Creates a new event object.- Parameters:
name
- map namekey
- key the event concernscurrentValue
- new value key is mapped topreviousValue
- value that was replaced
-
MapEvent
public MapEvent(MapEvent.Type type, String name, K key, Versioned<V> currentValue, Versioned<V> previousValue)
Creates a new event object.- Parameters:
type
- event typename
- map namekey
- key the event concernscurrentValue
- new value key is mapped topreviousValue
- value that was replaced
-
-
Method Detail
-
name
public String name()
Returns the map name.- Returns:
- name of map
-
type
public MapEvent.Type type()
Returns the type of the event.- Returns:
- the type of event
-
key
public K key()
Returns the key this event concerns.- Returns:
- the key
-
newValue
public Versioned<V> newValue()
Returns the new value in the map associated with the key. Iftype()
returnsREMOVE
, this method will returnnull
.- Returns:
- the new value for key
-
oldValue
public Versioned<V> oldValue()
Returns the value associated with the key, before it was updated.- Returns:
- previous value in map for the key
-
-