Class EventDataCache

java.lang.Object
com.vaadin.flow.component.internal.EventDataCache
All Implemented Interfaces:
Serializable

public class EventDataCache extends Object implements Serializable
Cache for tracking global information related to ComponentEvent types.

For internal use only. May be renamed or removed in a future release.

Since:
1.0
Author:
Vaadin Ltd
See Also:
  • Constructor Details

    • EventDataCache

      public EventDataCache()
  • Method Details

    • getDataExpressions

      public Optional<LinkedHashMap<String,Class<?>>> getDataExpressions(Class<? extends ComponentEvent<?>> eventType)
      Gets the cached data expressions for the given event type.
      Parameters:
      eventType - the component event type
      Returns:
      an optional containing the data expressions or an empty optional if no data expressions have been cached for the given event type
    • setDataExpressions

      public LinkedHashMap<String,Class<?>> setDataExpressions(Class<? extends ComponentEvent<?>> eventType, LinkedHashMap<String,Class<?>> expressions)
      Stores the given data expressions for the given event type in the cache.
      Parameters:
      eventType - the component event type
      expressions - the data expressions to store
      Returns:
      the stored data expressions
    • getEventConstructor

      public <T extends ComponentEvent<?>> Optional<Constructor<T>> getEventConstructor(Class<T> eventType)
      Gets the cached DOM event constructor for the given event type.
      Type Parameters:
      T - the component event type
      Parameters:
      eventType - the component event type
      Returns:
      an optional containing the DOM event constructor or an empty optional if no DOM event constructor has been cached for the given event type
    • setEventConstructor

      public <T extends ComponentEvent<?>> Constructor<T> setEventConstructor(Class<T> eventType, Constructor<T> constructor)
      Stores the given DOM event constructor for the given event type in the cache.
      Type Parameters:
      T - the event type
      Parameters:
      eventType - the component event type
      constructor - the DOM event constructor to store
      Returns:
      the stored DOM event constructor