Class VariantPropertyGetterCache

java.lang.Object
com.espertech.esper.common.internal.event.variant.VariantPropertyGetterCache

public class VariantPropertyGetterCache extends Object
A thread-safe cache for property getters per event type.

Since most often getters are used in a row for the same type, keeps a row of last used getters for fast lookup based on type.

  • Field Details

  • Constructor Details

    • VariantPropertyGetterCache

      public VariantPropertyGetterCache(EventType[] knownTypes)
      Ctor.
      Parameters:
      knownTypes - types known at cache construction type, may be an empty list for the ANY type variance.
  • Method Details

    • addGetters

      public void addGetters(String propertyName)
      Adds the getters for a property that is identified by a property number which indexes into array of getters per type.
      Parameters:
      propertyName - to add
    • getGetter

      public EventPropertyGetter getGetter(String propertyName, EventType eventType)
      Fast lookup of a getter for a property and type.
      Parameters:
      propertyName - property name
      eventType - type of underlying event
      Returns:
      getter