Class NaturalEventBean

java.lang.Object
com.espertech.esper.common.internal.event.core.NaturalEventBean
All Implemented Interfaces:
EventBean, DecoratingEventBean

public class NaturalEventBean extends Object implements EventBean, DecoratingEventBean
An event that is carries multiple representations of event properties: A synthetic representation that is designed for delivery as EventBean to client update listener code, and a natural representation as a bunch of Object-type properties for fast delivery to client subscriber objects via method call.
  • Field Details

  • Constructor Details

    • NaturalEventBean

      public NaturalEventBean(EventType eventBeanType, Object[] natural, EventBean optionalSynthetic)
      Ctor.
      Parameters:
      eventBeanType - the event type of the synthetic event
      natural - the properties of the event
      optionalSynthetic - the event bean that is the synthetic event, or null if no synthetic is packed in
  • Method Details

    • getEventType

      public EventType getEventType()
      Description copied from interface: EventBean
      Return the EventType instance that describes the set of properties available for this event.
      Specified by:
      getEventType in interface EventBean
      Returns:
      event type
    • get

      public Object get(String property) throws PropertyAccessException
      Description copied from interface: EventBean
      Returns the value of an event property for the given property name or property expression.

      Returns null if the property value is null. Throws an exception if the expression is not valid against the event type.

      The method takes a property name or property expression as a parameter. Property expressions may include indexed properties via the syntax "name[index]", mapped properties via the syntax "name('key')", nested properties via the syntax "outer.inner" or combinations thereof.

      Specified by:
      get in interface EventBean
      Parameters:
      property - - name or expression of the property whose value is to be retrieved
      Returns:
      the value of a property with the specified name.
      Throws:
      PropertyAccessException - - if there is no property of the specified name, or the property cannot be accessed
    • getUnderlying

      public Object getUnderlying()
      Description copied from interface: EventBean
      Get the underlying data object to this event wrapper.
      Specified by:
      getUnderlying in interface EventBean
      Returns:
      underlying data object, usually either a Map or a Java bean instance.
    • getUnderlyingEvent

      public EventBean getUnderlyingEvent()
      Description copied from interface: DecoratingEventBean
      Returns the underlying event to the decorated event.
      Specified by:
      getUnderlyingEvent in interface DecoratingEventBean
      Returns:
      underlying
    • getDecoratingProperties

      public Map<String,Object> getDecoratingProperties()
      Description copied from interface: DecoratingEventBean
      Returns decorating properties.
      Specified by:
      getDecoratingProperties in interface DecoratingEventBean
      Returns:
      property name and values
    • getNatural

      public Object[] getNatural()
      Returns the column object result representation.
      Returns:
      select column values
    • getOptionalSynthetic

      public EventBean getOptionalSynthetic()
      Returns the synthetic event that can be attached.
      Returns:
      synthetic if attached, or null if none attached
    • getFragment

      public Object getFragment(String propertyExpression)
      Description copied from interface: EventBean
      Returns event beans or array of event bean for a property name or property expression.

      For use with properties whose value is itself an event or whose value can be represented as an event by the underlying event representation.

      The EventType of the event bean instance(s) returned by this method can be determined by EventType.getFragmentType(String). Use EventPropertyDescriptor to obtain a list of properties that return fragments from an event type.

      Returns null if the property value is null or the property value cannot be represented as a fragment by the underlying representation.

      The method takes a property name or property expression as a parameter. Property expressions may include indexed properties via the syntax "name[index]", mapped properties via the syntax "name('key')", nested properties via the syntax "outer.inner" or combinations thereof.

      Specified by:
      getFragment in interface EventBean
      Parameters:
      propertyExpression - - name or expression of the property whose value is to be presented as an EventBean or array of EventBean
      Returns:
      the value of a property as an EventBean or array of EventBean