Class MapChangeEvent

  • All Implemented Interfaces:
    java.io.Serializable

    public class MapChangeEvent
    extends java.util.EventObject
    Event that is fired when the value in a collaboration map changes.
    Since:
    1.0
    Author:
    Vaadin Ltd
    See Also:
    Serialized Form
    • Field Summary

      • Fields inherited from class java.util.EventObject

        source
    • Constructor Summary

      Constructors 
      Constructor Description
      MapChangeEvent​(CollaborationMap source, com.vaadin.collaborationengine.MapChange change)
      Creates a new map change event.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getKey()
      Gets the updated map key.
      <T> T getOldValue​(com.fasterxml.jackson.core.type.TypeReference<T> typeRef)
      Gets the old value as an instance corresponding to the given type reference.
      <T> T getOldValue​(java.lang.Class<T> type)
      Gets the old value as an instance of the given class.
      CollaborationMap getSource()  
      <T> T getValue​(com.fasterxml.jackson.core.type.TypeReference<T> typeRef)
      Gets the new value as an instance corresponding to the given type reference.
      <T> T getValue​(java.lang.Class<T> type)
      Gets the new value as an instance of the given class.
      • Methods inherited from class java.util.EventObject

        toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • MapChangeEvent

        public MapChangeEvent​(CollaborationMap source,
                              com.vaadin.collaborationengine.MapChange change)
        Creates a new map change event.
        Parameters:
        source - the collaboration map for which the event is fired, not null
        change - detail of the change, not null
        Since:
        1.0
    • Method Detail

      • getSource

        public CollaborationMap getSource()
        Overrides:
        getSource in class java.util.EventObject
      • getKey

        public java.lang.String getKey()
        Gets the updated map key.
        Returns:
        the updated map key, not null
        Since:
        1.0
      • getOldValue

        public <T> T getOldValue​(java.lang.Class<T> type)
        Gets the old value as an instance of the given class.
        Type Parameters:
        T - the type of the value from type parameter, e.g. String
        Parameters:
        type - the expected type of the returned instance
        Returns:
        the old map value, or null if no value was present previously
        Since:
        1.0
      • getOldValue

        public <T> T getOldValue​(com.fasterxml.jackson.core.type.TypeReference<T> typeRef)
        Gets the old value as an instance corresponding to the given type reference.
        Type Parameters:
        T - the type reference of the value from typeRef parameter, e.g. List>
        Parameters:
        typeRef - the expected type reference of the returned instance
        Returns:
        the old map value, or null if no value was present previously
        Since:
        1.0
      • getValue

        public <T> T getValue​(java.lang.Class<T> type)
        Gets the new value as an instance of the given class.
        Type Parameters:
        T - the type of the value from type parameter, e.g. String
        Parameters:
        type - the expected type of the returned instance
        Returns:
        the new map value, or null if the association was removed
        Since:
        1.0
      • getValue

        public <T> T getValue​(com.fasterxml.jackson.core.type.TypeReference<T> typeRef)
        Gets the new value as an instance corresponding to the given type reference.
        Type Parameters:
        T - the type reference of the value from `typeRef` parameter, e.g. List>
        Parameters:
        typeRef - the expected type reference of the returned instance
        Returns:
        the new map value, or null if the association was removed
        Since:
        1.0