Class EventBeanUtility

java.lang.Object
com.espertech.esper.common.internal.event.core.EventBeanUtility

public class EventBeanUtility extends Object
Method to getSelectListEvents events in collections to other collections or other event types.
  • Field Details

  • Constructor Details

    • EventBeanUtility

      public EventBeanUtility()
  • Method Details

    • allocatePerStreamShift

      public static EventBean[] allocatePerStreamShift(EventBean[] eventsPerStream)
      Code-generation-invoked method, method name and parameter order matters
      Parameters:
      eventsPerStream - events
      Returns:
      shifted
    • getNonemptyFirstEventUnderlying

      public static Object getNonemptyFirstEventUnderlying(Collection<EventBean> matchingEvents)
      NOTE: Code-generation-invoked method, method name and parameter order matters
      Parameters:
      matchingEvents - matching
      Returns:
      first
    • getNonemptyFirstEvent

      public static EventBean getNonemptyFirstEvent(Collection<EventBean> matchingEvents)
      NOTE: Code-generation-invoked method, method name and parameter order matters
      Parameters:
      matchingEvents - events
      Returns:
      event
    • getAssertPropertyGetter

      public static EventPropertyGetter getAssertPropertyGetter(EventType type, String propertyName)
    • getAssertPropertyGetter

      public static EventPropertyGetter getAssertPropertyGetter(EventType[] eventTypes, int keyStreamNum, String property)
    • resizeArray

      public static EventBean[] resizeArray(EventBean[] oldArray, int newSize)
      Resizes an array of events to a new size.

      Returns the same array reference if the size is the same.

      Parameters:
      oldArray - array to resize
      newSize - new array size
      Returns:
      resized array
    • flattenList

      public static UniformPair<EventBean[]> flattenList(ArrayDeque<UniformPair<EventBean[]>> eventVector)
      Flatten the vector of arrays to an array. Return null if an empty vector was passed, else return an array containing all the events.
      Parameters:
      eventVector - vector
      Returns:
      array with all events
    • flatten

      public static EventBean[] flatten(ArrayDeque<EventBean[]> eventVector)
      Flatten the vector of arrays to an array. Return null if an empty vector was passed, else return an array containing all the events.
      Parameters:
      eventVector - vector
      Returns:
      array with all events
    • flattenBatchStream

      public static UniformPair<EventBean[]> flattenBatchStream(List<UniformPair<EventBean[]>> updateVector)
      NOTE: Code-generation-invoked method, method name and parameter order matters Flatten the vector of arrays to an array. Return null if an empty vector was passed, else return an array containing all the events.
      Parameters:
      updateVector - is a list of updates of old and new events
      Returns:
      array with all events
    • append

      protected static EventBean[] append(EventBean[] source, EventBean[] append)
      Append arrays.
      Parameters:
      source - array
      append - array
      Returns:
      appended array
    • toArray

      public static EventBean[] toArray(Collection<EventBean> eventList)
      Convert list of events to array, returning null for empty or null lists.
      Parameters:
      eventList - is a list of events to convert
      Returns:
      array of events
    • getPropertyArray

      public static Object[] getPropertyArray(EventBean theEvent, EventPropertyGetter[] propertyGetters)
      Returns object array containing property values of given properties, retrieved via EventPropertyGetter instances.
      Parameters:
      theEvent - - event to get property values from
      propertyGetters - - getters to use for getting property values
      Returns:
      object array with property values
    • getPropertyArray

      public static Object[] getPropertyArray(EventBean[] eventsPerStream, EventPropertyGetter[] propertyGetters, int[] streamNums)
    • coerce

      public static Object coerce(Object target, EPTypeClass coercionType)
    • coerce

      public static Object coerce(Object target, Class coercionType)
    • printEvent

      public static String printEvent(EventBean theEvent)
      Format the event and return a string representation.
      Parameters:
      theEvent - is the event to format.
      Returns:
      string representation of event
    • printEvents

      public static String printEvents(EventBean[] events)
    • appendEvent

      public static void appendEvent(StringWriter writer, EventBean theEvent)
    • flattenBatchJoin

      public static UniformPair<Set<MultiKeyArrayOfKeys<EventBean>>> flattenBatchJoin(List<UniformPair<Set<MultiKeyArrayOfKeys<EventBean>>>> joinPostings)
      NOTE: Code-generation-invoked method, method name and parameter order matters Flattens a list of pairs of join result sets.
      Parameters:
      joinPostings - is the list
      Returns:
      is the consolidate sets
    • addToArray

      public static EventBean[] addToArray(EventBean[] array, EventBean eventToAdd)
      Expand the array passed in by the single element to add.
      Parameters:
      array - to expand
      eventToAdd - element to add
      Returns:
      resized array
    • addToArray

      public static EventBean[] addToArray(EventBean[] array, Collection<EventBean> eventsToAdd)
      Expand the array passed in by the multiple elements to add.
      Parameters:
      array - to expand
      eventsToAdd - elements to add
      Returns:
      resized array
    • createNativeFragmentType

      public static FragmentEventType createNativeFragmentType(EPType type, BeanEventTypeFactory beanEventTypeFactory, boolean publicFields)
      Create a fragment event type.
      Parameters:
      type - property type
      beanEventTypeFactory - for event types
      publicFields - indicator whether classes are public-field-property-accessible
      Returns:
      fragment type
    • getDistinctByProp

      public static EventBean[] getDistinctByProp(ArrayDeque<EventBean> events, EventPropertyValueGetter getter)
    • getDistinctByProp

      public static EventBean[] getDistinctByProp(EventBean[] events, EventPropertyValueGetter getter)
      Returns the distinct events by properties.
      Parameters:
      events - to inspect
      getter - for retrieving properties
      Returns:
      distinct events
    • denaturalize

      public static EventBean[] denaturalize(EventBean[] naturals)
    • eventsAreEqualsAllowNull

      public static boolean eventsAreEqualsAllowNull(EventBean first, EventBean second)
    • safeArrayCopy

      public static void safeArrayCopy(EventBean[] eventsPerStream, EventBean[] eventsLambda)
    • getNewDataNonRemoved

      public static EventBean[] getNewDataNonRemoved(EventBean[] newData, HashSet<EventBean> removedEvents)
    • getNewDataNonRemoved

      public static EventBean[] getNewDataNonRemoved(EventBean[] newData, HashSet<EventBean> removedEvents, EventBean[][] newEventsPerView)
    • toString

      public static String toString(Map<String,Object> map)
      Renders a map of elements, in which elements can be events or event arrays interspersed with other objects,
      Parameters:
      map - to render
      Returns:
      comma-separated list of map entry name-value pairs
    • addToCollection

      public static void addToCollection(EventBean[] toAdd, Collection<EventBean> events)
    • addToCollection

      public static void addToCollection(Set<MultiKeyArrayOfKeys<EventBean>> toAdd, Collection<MultiKeyArrayOfKeys<EventBean>> events)
    • toArrayNullIfEmpty

      public static EventBean[] toArrayNullIfEmpty(Collection<EventBean> events)
    • toLinkedHashSetNullIfEmpty

      public static Set<MultiKeyArrayOfKeys<EventBean>> toLinkedHashSetNullIfEmpty(Collection<MultiKeyArrayOfKeys<EventBean>> events)
    • toSingletonSetIfNotNull

      public static Set<MultiKeyArrayOfKeys<EventBean>> toSingletonSetIfNotNull(MultiKeyArrayOfKeys<EventBean> row)
    • getLastInSet

      public static MultiKeyArrayOfKeys<EventBean> getLastInSet(Set<MultiKeyArrayOfKeys<EventBean>> events)
    • toArrayIfNotNull

      public static EventBean[] toArrayIfNotNull(EventBean optionalEvent)
    • compareEventReferences

      public static boolean compareEventReferences(EventBean[] firstNonNull, EventBean[] secondNonNull)
    • copyArray

      public static EventBean[] copyArray(EventBean[] events)
    • evaluateFilterExpectSingleMatch

      public static EventBean evaluateFilterExpectSingleMatch(EventBean[] eventsZeroSubselect, boolean newData, Collection<EventBean> matchingEvents, ExprEvaluatorContext exprEvaluatorContext, ExprEvaluator filter)
      NOTE: Code-generation-invoked method, method name and parameter order matters
      Parameters:
      eventsZeroSubselect - events
      newData - new data flag
      matchingEvents - collection of events
      exprEvaluatorContext - ctx
      filter - filter expression
      Returns:
      first matching