Class EventBeanUtility
java.lang.Object
com.espertech.esper.common.internal.event.core.EventBeanUtility
Method to getSelectListEvents events in collections to other collections or other event types.
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic EventBean[]
addToArray
(EventBean[] array, EventBean eventToAdd) Expand the array passed in by the single element to add.static EventBean[]
addToArray
(EventBean[] array, Collection<EventBean> eventsToAdd) Expand the array passed in by the multiple elements to add.static void
addToCollection
(EventBean[] toAdd, Collection<EventBean> events) static void
addToCollection
(Set<MultiKeyArrayOfKeys<EventBean>> toAdd, Collection<MultiKeyArrayOfKeys<EventBean>> events) static EventBean[]
allocatePerStreamShift
(EventBean[] eventsPerStream) Code-generation-invoked method, method name and parameter order mattersprotected static EventBean[]
Append arrays.static void
appendEvent
(StringWriter writer, EventBean theEvent) static Object
coerce
(Object target, EPTypeClass coercionType) static Object
static boolean
compareEventReferences
(EventBean[] firstNonNull, EventBean[] secondNonNull) static EventBean[]
static FragmentEventType
createNativeFragmentType
(EPType type, BeanEventTypeFactory beanEventTypeFactory, boolean publicFields) Create a fragment event type.static EventBean[]
denaturalize
(EventBean[] naturals) static EventBean
evaluateFilterExpectSingleMatch
(EventBean[] eventsZeroSubselect, boolean newData, Collection<EventBean> matchingEvents, ExprEvaluatorContext exprEvaluatorContext, ExprEvaluator filter) NOTE: Code-generation-invoked method, method name and parameter order mattersstatic boolean
eventsAreEqualsAllowNull
(EventBean first, EventBean second) static EventBean[]
flatten
(ArrayDeque<EventBean[]> eventVector) Flatten the vector of arrays to an array.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.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.static UniformPair<EventBean[]>
flattenList
(ArrayDeque<UniformPair<EventBean[]>> eventVector) Flatten the vector of arrays to an array.static EventPropertyGetter
getAssertPropertyGetter
(EventType[] eventTypes, int keyStreamNum, String property) static EventPropertyGetter
getAssertPropertyGetter
(EventType type, String propertyName) static EventBean[]
getDistinctByProp
(EventBean[] events, EventPropertyValueGetter getter) Returns the distinct events by properties.static EventBean[]
getDistinctByProp
(ArrayDeque<EventBean> events, EventPropertyValueGetter getter) static MultiKeyArrayOfKeys<EventBean>
getLastInSet
(Set<MultiKeyArrayOfKeys<EventBean>> events) static EventBean[]
getNewDataNonRemoved
(EventBean[] newData, HashSet<EventBean> removedEvents) static EventBean[]
getNewDataNonRemoved
(EventBean[] newData, HashSet<EventBean> removedEvents, EventBean[][] newEventsPerView) static EventBean
getNonemptyFirstEvent
(Collection<EventBean> matchingEvents) NOTE: Code-generation-invoked method, method name and parameter order mattersstatic Object
getNonemptyFirstEventUnderlying
(Collection<EventBean> matchingEvents) NOTE: Code-generation-invoked method, method name and parameter order mattersstatic Object[]
getPropertyArray
(EventBean[] eventsPerStream, EventPropertyGetter[] propertyGetters, int[] streamNums) static Object[]
getPropertyArray
(EventBean theEvent, EventPropertyGetter[] propertyGetters) Returns object array containing property values of given properties, retrieved via EventPropertyGetter instances.static String
printEvent
(EventBean theEvent) Format the event and return a string representation.static String
printEvents
(EventBean[] events) static EventBean[]
resizeArray
(EventBean[] oldArray, int newSize) Resizes an array of events to a new size.static void
safeArrayCopy
(EventBean[] eventsPerStream, EventBean[] eventsLambda) static EventBean[]
toArray
(Collection<EventBean> eventList) Convert list of events to array, returning null for empty or null lists.static EventBean[]
toArrayIfNotNull
(EventBean optionalEvent) static EventBean[]
toArrayNullIfEmpty
(Collection<EventBean> events) static Set<MultiKeyArrayOfKeys<EventBean>>
static Set<MultiKeyArrayOfKeys<EventBean>>
static String
Renders a map of elements, in which elements can be events or event arrays interspersed with other objects,
-
Field Details
-
METHOD_FLATTENBATCHJOIN
- See Also:
-
METHOD_FLATTENBATCHSTREAM
- See Also:
-
-
Constructor Details
-
EventBeanUtility
public EventBeanUtility()
-
-
Method Details
-
allocatePerStreamShift
Code-generation-invoked method, method name and parameter order matters- Parameters:
eventsPerStream
- events- Returns:
- shifted
-
getNonemptyFirstEventUnderlying
NOTE: Code-generation-invoked method, method name and parameter order matters- Parameters:
matchingEvents
- matching- Returns:
- first
-
getNonemptyFirstEvent
NOTE: Code-generation-invoked method, method name and parameter order matters- Parameters:
matchingEvents
- events- Returns:
- event
-
getAssertPropertyGetter
-
getAssertPropertyGetter
public static EventPropertyGetter getAssertPropertyGetter(EventType[] eventTypes, int keyStreamNum, String property) -
resizeArray
Resizes an array of events to a new size.Returns the same array reference if the size is the same.
- Parameters:
oldArray
- array to resizenewSize
- 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
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
Append arrays.- Parameters:
source
- arrayappend
- array- Returns:
- appended array
-
toArray
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
Returns object array containing property values of given properties, retrieved via EventPropertyGetter instances.- Parameters:
theEvent
- - event to get property values frompropertyGetters
- - 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
-
coerce
-
printEvent
Format the event and return a string representation.- Parameters:
theEvent
- is the event to format.- Returns:
- string representation of event
-
printEvents
-
appendEvent
-
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
Expand the array passed in by the single element to add.- Parameters:
array
- to expandeventToAdd
- element to add- Returns:
- resized array
-
addToArray
Expand the array passed in by the multiple elements to add.- Parameters:
array
- to expandeventsToAdd
- 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 typebeanEventTypeFactory
- for event typespublicFields
- indicator whether classes are public-field-property-accessible- Returns:
- fragment type
-
getDistinctByProp
public static EventBean[] getDistinctByProp(ArrayDeque<EventBean> events, EventPropertyValueGetter getter) -
getDistinctByProp
Returns the distinct events by properties.- Parameters:
events
- to inspectgetter
- for retrieving properties- Returns:
- distinct events
-
denaturalize
-
eventsAreEqualsAllowNull
-
safeArrayCopy
-
getNewDataNonRemoved
-
getNewDataNonRemoved
-
toString
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
-
addToCollection
public static void addToCollection(Set<MultiKeyArrayOfKeys<EventBean>> toAdd, Collection<MultiKeyArrayOfKeys<EventBean>> events) -
toArrayNullIfEmpty
-
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
-
compareEventReferences
-
copyArray
-
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
- eventsnewData
- new data flagmatchingEvents
- collection of eventsexprEvaluatorContext
- ctxfilter
- filter expression- Returns:
- first matching
-