public class EPTypeHelper extends Object
Use factory methods to initialize return type information according to the return values that your expression is going to provide.
collectionOfEvents(com.espertech.esper.client.EventType)
to indicate that the expression returns a collection of events.
singleEvent(com.espertech.esper.client.EventType)
to indicate that the expression returns a single event.
collectionOfSingleValue(Class)
to indicate that the expression returns a collection of single values.
A single value can be any object including null.
array(Class)
to indicate that the expression returns an array of single values.
A single value can be any object including null.
singleValue(Class)
to indicate that the expression returns a single value.
A single value can be any object including null.
Such expression results cannot be used as input to enumeration methods, for example.
Constructor and Description |
---|
EPTypeHelper() |
Modifier and Type | Method and Description |
---|---|
static EPType |
array(Class arrayComponentType)
Indicate that the expression return type is an array of a given component type.
|
static EPType |
collectionOfEvents(EventType eventTypeOfCollectionEvents)
Indicate that the expression return type is a collection of a given type of events.
|
static EPType |
collectionOfSingleValue(Class collectionComponentType)
Indicate that the expression return type is a collection of a given component type.
|
static EPType |
fromMethod(Method method)
Interrogate the provided method and determine whether it returns
single-value, array of single-value or collection of single-value and
their component type.
|
static Class |
getClassMultiValued(EPType type) |
static Class |
getClassSingleValued(EPType type) |
static Class |
getCodegenReturnType(EPType theType) |
static EventType |
getEventType(EPType epType) |
static EventType |
getEventTypeMultiValued(EPType type) |
static EventType |
getEventTypeSingleValued(EPType type) |
static Class |
getNormalizedClass(EPType theType) |
static boolean |
isCarryEvent(EPType epType) |
static EPType |
nullValue() |
static EPType |
optionalFromEnumerationExpr(int statementId,
EventAdapterService eventAdapterService,
ExprNode exprNode) |
static Class |
optionalIsComponentTypeColl(EPType type) |
static EventType |
optionalIsEventTypeColl(EPType type) |
static EventType |
optionalIsEventTypeSingle(EPType type) |
static EPType |
singleEvent(EventType eventTypeOfSingleEvent)
Indicate that the expression return type is single event of a given event type.
|
static EPType |
singleValue(Class singleValueType)
Indicate that the expression return type is a single (non-enumerable) value of the given type.
|
static String |
toTypeDescriptive(EPType epType)
Returns a nice text detailing the expression result type.
|
public static boolean isCarryEvent(EPType epType)
public static EPType array(Class arrayComponentType)
arrayComponentType
- array component typepublic static EPType singleValue(Class singleValueType)
singleValueType
- type of single value returned, or null to indicate that the expression always returns nullpublic static EPType nullValue()
public static EPType collectionOfSingleValue(Class collectionComponentType)
collectionComponentType
- collection component typepublic static EPType collectionOfEvents(EventType eventTypeOfCollectionEvents)
eventTypeOfCollectionEvents
- the event type of the events that are part of the collectionpublic static EPType singleEvent(EventType eventTypeOfSingleEvent)
eventTypeOfSingleEvent
- the event type of the event returnedpublic static EPType fromMethod(Method method)
method
- the class methodspublic static String toTypeDescriptive(EPType epType)
epType
- typepublic static EPType optionalFromEnumerationExpr(int statementId, EventAdapterService eventAdapterService, ExprNode exprNode) throws ExprValidationException
ExprValidationException