Package com.vaadin.collaborationengine
Class MapChangeEvent
java.lang.Object
java.util.EventObject
com.vaadin.collaborationengine.MapChangeEvent
- All Implemented Interfaces:
Serializable
Event that is fired when the value in a collaboration map changes.
- Since:
- 1.0
- Author:
- Vaadin Ltd
- See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionMapChangeEvent(CollaborationMap source, com.vaadin.collaborationengine.MapChange change) Creates a new map change event. -
Method Summary
Modifier and TypeMethodDescriptiongetKey()Gets the updated map key.<T> TgetOldValue(com.fasterxml.jackson.core.type.TypeReference<T> typeRef) Gets the old value as an instance corresponding to the given type reference.<T> TgetOldValue(Class<T> type) Gets the old value as an instance of the given class.<T> TgetValue(com.fasterxml.jackson.core.type.TypeReference<T> typeRef) Gets the new value as an instance corresponding to the given type reference.<T> TGets the new value as an instance of the given class.Methods inherited from class java.util.EventObject
toString
-
Constructor Details
-
MapChangeEvent
Creates a new map change event.- Parameters:
source- the collaboration map for which the event is fired, notnullchange- detail of the change, notnull- Since:
- 1.0
-
-
Method Details
-
getSource
- Overrides:
getSourcein classEventObject
-
getKey
Gets the updated map key.- Returns:
- the updated map key, not
null - Since:
- 1.0
-
getOldValue
Gets the old value as an instance of the given class.- Type Parameters:
T- the type of the value fromtypeparameter, e.g.String- Parameters:
type- the expected type of the returned instance- Returns:
- the old map value, or
nullif 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 fromtypeRefparameter, e.g.List> - Parameters:
typeRef- the expected type reference of the returned instance- Returns:
- the old map value, or
nullif no value was present previously - Since:
- 1.0
-
getValue
Gets the new value as an instance of the given class.- Type Parameters:
T- the type of the value fromtypeparameter, e.g.String- Parameters:
type- the expected type of the returned instance- Returns:
- the new map value, or
nullif 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
nullif the association was removed - Since:
- 1.0
-