Class MapEvent<K,​V>

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

    public class MapEvent<K,​V>
    extends Object
    Representation of a ConsistentMap update notification.
    • Constructor Detail

      • MapEvent

        public MapEvent​(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,
                        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 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
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object