public class EventBeanUtility
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
METHOD_FLATTENBATCHJOIN |
static java.lang.String |
METHOD_FLATTENBATCHSTREAM |
Constructor and Description |
---|
EventBeanUtility() |
Modifier and Type | Method and Description |
---|---|
static EventBean[] |
addToArray(EventBean[] array,
java.util.Collection<EventBean> eventsToAdd)
Expand the array passed in by the multiple elements to add.
|
static EventBean[] |
addToArray(EventBean[] array,
EventBean eventToAdd)
Expand the array passed in by the single element to add.
|
static void |
addToCollection(EventBean[] toAdd,
java.util.Collection<EventBean> events) |
static void |
addToCollection(java.util.Set<MultiKey<EventBean>> toAdd,
java.util.Collection<MultiKey<EventBean>> events) |
static EventBean[] |
allocatePerStreamShift(EventBean[] eventsPerStream) |
protected static EventBean[] |
append(EventBean[] source,
EventBean[] append)
Append arrays.
|
static void |
appendEvent(java.io.StringWriter writer,
EventBean theEvent) |
static java.lang.Object |
coerce(java.lang.Object target,
java.lang.Class coercionType) |
static boolean |
compareEventReferences(EventBean[] firstNonNull,
EventBean[] secondNonNull) |
static EventBean[] |
copyArray(EventBean[] events) |
static FragmentEventType |
createNativeFragmentType(java.lang.Class propertyType,
java.lang.Class genericType,
EventAdapterService eventAdapterService)
Create a fragment event type.
|
static EventBean[] |
denaturalize(EventBean[] naturals) |
static boolean |
eventsAreEqualsAllowNull(EventBean first,
EventBean second) |
static EventBean[] |
flatten(java.util.ArrayDeque<EventBean[]> eventVector)
Flatten the vector of arrays to an array.
|
static UniformPair<java.util.Set<MultiKey<EventBean>>> |
flattenBatchJoin(java.util.List<UniformPair<java.util.Set<MultiKey<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(java.util.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(java.util.ArrayDeque<UniformPair<EventBean[]>> eventVector)
Flatten the vector of arrays to an array.
|
static EventPropertyGetter |
getAssertPropertyGetter(EventType[] eventTypes,
int keyStreamNum,
java.lang.String property) |
static EventPropertyGetter |
getAssertPropertyGetter(EventType type,
java.lang.String propertyName) |
static EventBean[] |
getDistinctByProp(java.util.ArrayDeque<EventBean> events,
EventBeanReader reader)
Returns the distinct events by properties.
|
static EventBean[] |
getDistinctByProp(EventBean[] events,
EventBeanReader reader)
Returns the distinct events by properties.
|
static MultiKey<EventBean> |
getLastInSet(java.util.Set<MultiKey<EventBean>> events) |
static MultiKeyUntyped |
getMultiKey(EventBean[] eventsPerStream,
ExprEvaluator[] evaluators,
ExprEvaluatorContext context,
java.lang.Class[] coercionTypes) |
static MultiKeyUntyped |
getMultiKey(EventBean theEvent,
EventPropertyGetter[] propertyGetters)
Returns Multikey instance for given event and getters.
|
static MultiKeyUntyped |
getMultiKey(EventBean theEvent,
EventPropertyGetter[] propertyGetters,
java.lang.Class[] coercionTypes) |
static EventBean[] |
getNewDataNonRemoved(EventBean[] newData,
java.util.HashSet<EventBean> removedEvents) |
static EventBean[] |
getNewDataNonRemoved(EventBean[] newData,
java.util.HashSet<EventBean> removedEvents,
EventBean[][] newEventsPerView) |
static EventBean |
getNonemptyFirstEvent(java.util.Collection<EventBean> matchingEvents)
NOTE: Code-generation-invoked method, method name and parameter order matters
|
static java.lang.Object |
getNonemptyFirstEventUnderlying(java.util.Collection<EventBean> matchingEvents) |
static java.lang.Object[] |
getPropertyArray(EventBean[] eventsPerStream,
EventPropertyGetter[] propertyGetters,
int[] streamNums) |
static java.lang.Object[] |
getPropertyArray(EventBean theEvent,
EventPropertyGetter[] propertyGetters)
Returns object array containing property values of given properties, retrieved via EventPropertyGetter
instances.
|
static java.lang.String |
printEvent(EventBean theEvent)
Format the event and return a string representation.
|
static java.lang.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(java.util.Collection<EventBean> eventList)
Convert list of events to array, returning null for empty or null lists.
|
static EventBean[] |
toArrayIfNotNull(EventBean optionalEvent) |
static EventBean[] |
toArrayNullIfEmpty(java.util.Collection<EventBean> events) |
static java.util.Set<MultiKey<EventBean>> |
toLinkedHashSetNullIfEmpty(java.util.Collection<MultiKey<EventBean>> events) |
static java.util.Set<MultiKey<EventBean>> |
toSingletonSetIfNotNull(MultiKey<EventBean> row) |
static java.lang.String |
toString(java.util.Map<java.lang.String,java.lang.Object> map)
Renders a map of elements, in which elements can be events or event arrays interspersed with other objects,
|
public static final java.lang.String METHOD_FLATTENBATCHJOIN
public static final java.lang.String METHOD_FLATTENBATCHSTREAM
public static EventBean[] allocatePerStreamShift(EventBean[] eventsPerStream)
public static java.lang.Object getNonemptyFirstEventUnderlying(java.util.Collection<EventBean> matchingEvents)
public static EventBean getNonemptyFirstEvent(java.util.Collection<EventBean> matchingEvents)
matchingEvents
- eventspublic static EventPropertyGetter getAssertPropertyGetter(EventType type, java.lang.String propertyName)
public static EventPropertyGetter getAssertPropertyGetter(EventType[] eventTypes, int keyStreamNum, java.lang.String property)
public static EventBean[] resizeArray(EventBean[] oldArray, int newSize)
Returns the same array reference if the size is the same.
oldArray
- array to resizenewSize
- new array sizepublic static UniformPair<EventBean[]> flattenList(java.util.ArrayDeque<UniformPair<EventBean[]>> eventVector)
eventVector
- vectorpublic static EventBean[] flatten(java.util.ArrayDeque<EventBean[]> eventVector)
eventVector
- vectorpublic static UniformPair<EventBean[]> flattenBatchStream(java.util.List<UniformPair<EventBean[]>> updateVector)
updateVector
- is a list of updates of old and new eventsprotected static EventBean[] append(EventBean[] source, EventBean[] append)
source
- arrayappend
- arraypublic static EventBean[] toArray(java.util.Collection<EventBean> eventList)
eventList
- is a list of events to convertpublic static java.lang.Object[] getPropertyArray(EventBean theEvent, EventPropertyGetter[] propertyGetters)
theEvent
- - event to get property values frompropertyGetters
- - getters to use for getting property valuespublic static java.lang.Object[] getPropertyArray(EventBean[] eventsPerStream, EventPropertyGetter[] propertyGetters, int[] streamNums)
public static MultiKeyUntyped getMultiKey(EventBean theEvent, EventPropertyGetter[] propertyGetters)
theEvent
- - event to get property values frompropertyGetters
- - getters for access to propertiespublic static MultiKeyUntyped getMultiKey(EventBean theEvent, EventPropertyGetter[] propertyGetters, java.lang.Class[] coercionTypes)
public static MultiKeyUntyped getMultiKey(EventBean[] eventsPerStream, ExprEvaluator[] evaluators, ExprEvaluatorContext context, java.lang.Class[] coercionTypes)
public static java.lang.Object coerce(java.lang.Object target, java.lang.Class coercionType)
public static java.lang.String printEvent(EventBean theEvent)
theEvent
- is the event to format.public static java.lang.String printEvents(EventBean[] events)
public static void appendEvent(java.io.StringWriter writer, EventBean theEvent)
public static UniformPair<java.util.Set<MultiKey<EventBean>>> flattenBatchJoin(java.util.List<UniformPair<java.util.Set<MultiKey<EventBean>>>> joinPostings)
joinPostings
- is the listpublic static EventBean[] addToArray(EventBean[] array, EventBean eventToAdd)
array
- to expandeventToAdd
- element to addpublic static EventBean[] addToArray(EventBean[] array, java.util.Collection<EventBean> eventsToAdd)
array
- to expandeventsToAdd
- elements to addpublic static FragmentEventType createNativeFragmentType(java.lang.Class propertyType, java.lang.Class genericType, EventAdapterService eventAdapterService)
propertyType
- property return typegenericType
- property generic type parameter, or null if noneeventAdapterService
- for event typespublic static EventBean[] getDistinctByProp(java.util.ArrayDeque<EventBean> events, EventBeanReader reader)
events
- to inspectreader
- for retrieving propertiespublic static EventBean[] getDistinctByProp(EventBean[] events, EventBeanReader reader)
events
- to inspectreader
- for retrieving propertiespublic static boolean eventsAreEqualsAllowNull(EventBean first, EventBean second)
public static void safeArrayCopy(EventBean[] eventsPerStream, EventBean[] eventsLambda)
public static EventBean[] getNewDataNonRemoved(EventBean[] newData, java.util.HashSet<EventBean> removedEvents)
public static EventBean[] getNewDataNonRemoved(EventBean[] newData, java.util.HashSet<EventBean> removedEvents, EventBean[][] newEventsPerView)
public static java.lang.String toString(java.util.Map<java.lang.String,java.lang.Object> map)
map
- to renderpublic static void addToCollection(EventBean[] toAdd, java.util.Collection<EventBean> events)
public static void addToCollection(java.util.Set<MultiKey<EventBean>> toAdd, java.util.Collection<MultiKey<EventBean>> events)
public static EventBean[] toArrayNullIfEmpty(java.util.Collection<EventBean> events)
public static java.util.Set<MultiKey<EventBean>> toLinkedHashSetNullIfEmpty(java.util.Collection<MultiKey<EventBean>> events)
public static java.util.Set<MultiKey<EventBean>> toSingletonSetIfNotNull(MultiKey<EventBean> row)
public static MultiKey<EventBean> getLastInSet(java.util.Set<MultiKey<EventBean>> events)
public static boolean compareEventReferences(EventBean[] firstNonNull, EventBean[] secondNonNull)