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 java.lang.ObjectRepresentation of a ConsistentMap update notification. 
- 
- 
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMapEvent.TypeMapEvent type. 
- 
Constructor Summary
Constructors Constructor Description MapEvent(java.lang.String name, K key, Versioned<V> currentValue, Versioned<V> previousValue)Creates a new event object.MapEvent(MapEvent.Type type, java.lang.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 booleanequals(java.lang.Object o)inthashCode()Kkey()Returns the key this event concerns.java.lang.Stringname()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.java.lang.StringtoString()MapEvent.Typetype()Returns the type of the event. 
 - 
 
- 
- 
Constructor Detail
- 
MapEvent
public MapEvent(java.lang.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, java.lang.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 java.lang.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
 
 
- 
equals
public boolean equals(java.lang.Object o)
- Overrides:
 equalsin classjava.lang.Object
 
- 
hashCode
public int hashCode()
- Overrides:
 hashCodein classjava.lang.Object
 
- 
toString
public java.lang.String toString()
- Overrides:
 toStringin classjava.lang.Object
 
 - 
 
 -