Class SimpleMapEvent<K,​V>


  • public class SimpleMapEvent<K,​V>
    extends Object
    Simple representation of MapEvent that can be marshalled to JSON.
    Author:
    as 2015.06.26
    • Constructor Detail

      • SimpleMapEvent

        public SimpleMapEvent()
        Deserialization constructor.
      • SimpleMapEvent

        public SimpleMapEvent​(MapEvent<? extends K,​? extends V> evt)
        Construct SimpleMapEvent instance.
        Parameters:
        evt - the MapEvent to construct this instance from
    • Method Detail

      • getCache

        public String getCache()
        Return the cache name.
        Returns:
        the cache name
      • setCache

        public void setCache​(String sCache)
        Set the cache name.
        Parameters:
        sCache - the cache name
      • getType

        public int getType()
        Return the event type.

        The value is one of:

        1. INSERTED
        2. UPDATED
        3. 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

        public K getKey()
        Return the key associated with this event.
        Returns:
        the key
      • setKey

        public void setKey​(K key)
        Set the key for this event.
        Parameters:
        key - the key
      • getOldValue

        public V 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

        public void setOldValue​(V oldValue)
        Set the old value.
        Parameters:
        oldValue - the old value
      • getNewValue

        public V 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

        public void setNewValue​(V newValue)
        Set the new value.
        Parameters:
        newValue - the new value