Class MapEvent<K,​V>

  • Type Parameters:
    K - key type
    V - value type

    public class MapEvent<K,​V>
    extends java.lang.Object
    Representation of a ConsistentMap update notification.
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  MapEvent.Type
      MapEvent type.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object o)  
      int hashCode()  
      K key()
      Returns the key this event concerns.
      java.lang.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.
      java.lang.String toString()  
      MapEvent.Type type()
      Returns the type of the event.
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • 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 name
        key - key the event concerns
        currentValue - new value key is mapped to
        previousValue - 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 type
        name - map name
        key - key the event concerns
        currentValue - new value key is mapped to
        previousValue - 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. If type() returns REMOVE, this method will return null.
        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:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object