Class Expressions

java.lang.Object
com.espertech.esper.common.client.soda.Expressions
All Implemented Interfaces:
Serializable

public class Expressions extends Object implements Serializable
Convenience factory for creating Expression instances.

Provides quick-access methods to create all possible expressions and provides typical parameter lists to each.

Note that only the typical parameter lists are provided and expressions can allow adding additional parameters.

Many expressions, for example logical AND and OR (conjunction and disjunction), allow adding an unlimited number of additional sub-expressions to an expression. For those expressions there are additional add methods provided.

See Also:
  • Constructor Details

    • Expressions

      public Expressions()
  • Method Details

    • currentTimestamp

      public static CurrentTimestampExpression currentTimestamp()
      Current system time supplies internal-timer provided time or the time provided by external timer events.
      Returns:
      expression
    • existsProperty

      public static PropertyExistsExpression existsProperty(String propertyName)
      Exists-function for use with dynamic properties to test property existence.
      Parameters:
      propertyName - name of the property to test whether it exists or not
      Returns:
      expression
    • cast

      public static CastExpression cast(Expression expression, String typeName)
      Cast function, casts the result on an expression to the desired type, or returns null if the type cannot be casted to the type.

      The list of types can include fully-qualified class names plus any of the Java primitive type names: byte, char, short, int, long, float, double, boolean. Alternatively to "java.lang.String" the simple "string" is also permitted.

      Type checks include all superclasses and interfaces of the value returned by the expression.

      Parameters:
      expression - returns the value to cast
      typeName - is type to cast to
      Returns:
      expression
    • cast

      public static CastExpression cast(String propertyName, String typeName)
      Cast function, casts the result on an expression to the desired type, or returns null if the type cannot be casted to the type.

      The list of types can include fully-qualified class names plus any of the Java primitive type names: byte, char, short, int, long, float, double, boolean. Alternatively to "java.lang.String" the simple "string" is also permitted.

      Type checks include all superclasses and interfaces of the value returned by the expression.

      Parameters:
      propertyName - name of the property supplying the value to cast
      typeName - is type to cast to
      Returns:
      expression
    • instanceOf

      public static InstanceOfExpression instanceOf(Expression expression, String typeName, String... typeNames)
      Instance-of function, tests if the type of the return value of an expression is in a list of types.

      The list of types can include fully-qualified class names plus any of the Java primitive type names: byte, char, short, int, long, float, double, boolean. Alternatively to "java.lang.String" the simple "string" is also permitted.

      Type checks include all superclasses and interfaces of the value returned by the expression.

      Parameters:
      expression - returns the value to test whether the type returned is any of the is the function name
      typeName - is one type to check for
      typeNames - is optional additional types to check for in a list
      Returns:
      expression
    • instanceOf

      public static InstanceOfExpression instanceOf(String propertyName, String typeName, String... typeNames)
      Instance-of function, tests if the type of the return value of a property is in a list of types.

      Useful with dynamic (unchecked) properties to check the type of property returned.

      The list of types can include fully-qualified class names plus any of the Java primitive type names: byte, char, short, int, long, float, double, boolean. Alternatively to "java.lang.String" the simple "string" is also permitted.

      Type checks include all superclasses and interfaces of the value returned by the expression.

      Parameters:
      propertyName - name of the property supplying the value to test
      typeName - is one type to check for
      typeNames - is optional additional types to check for in a list
      Returns:
      expression
    • typeOf

      public static TypeOfExpression typeOf(Expression expression)
      Type-of function, returns the event type name or result type as a string of a stream name, property or expression.
      Parameters:
      expression - to evaluate and return it's result type as a string
      Returns:
      expression
    • typeOf

      public static TypeOfExpression typeOf(String propertyName)
      Type-of function, returns the event type name or result type as a string of a stream name, property or expression.
      Parameters:
      propertyName - returns the property to evaluate and return its event type name or property class type
      Returns:
      expression
    • plugInAggregation

      public static PlugInProjectionExpression plugInAggregation(String functionName, Expression... moreExpressions)
      Plug-in aggregation function.
      Parameters:
      functionName - is the function name
      moreExpressions - provides the values to aggregate
      Returns:
      expression
    • regexp

      public static RegExpExpression regexp(Expression left, Expression right)
      Regular expression.
      Parameters:
      left - returns the values to match
      right - returns the value to match against
      Returns:
      expression
    • regexp

      public static RegExpExpression regexp(Expression left, Expression right, String escape)
      Regular expression.
      Parameters:
      left - returns the values to match
      right - returns the value to match against
      escape - is the escape character
      Returns:
      expression
    • regexp

      public static RegExpExpression regexp(String property, String regExExpression)
      Regular expression.
      Parameters:
      property - the name of the property returning values to match
      regExExpression - a regular expression to match against
      Returns:
      expression
    • regexp

      public static RegExpExpression regexp(String property, String regExExpression, String escape)
      Regular expression.
      Parameters:
      property - the name of the property returning values to match
      regExExpression - a regular expression to match against
      escape - is the escape character
      Returns:
      expression
    • notRegexp

      public static RegExpExpression notRegexp(Expression left, Expression right)
      Regular expression negated (not regexp).
      Parameters:
      left - returns the values to match
      right - returns the value to match against
      Returns:
      expression
    • notRegexp

      public static RegExpExpression notRegexp(Expression left, Expression right, String escape)
      Regular expression negated (not regexp).
      Parameters:
      left - returns the values to match
      right - returns the value to match against
      escape - is the escape character
      Returns:
      expression
    • notRegexp

      public static RegExpExpression notRegexp(String property, String regExExpression)
      Regular expression negated (not regexp).
      Parameters:
      property - the name of the property returning values to match
      regExExpression - a regular expression to match against
      Returns:
      expression
    • notRegexp

      public static RegExpExpression notRegexp(String property, String regExExpression, String escape)
      Regular expression negated (not regexp).
      Parameters:
      property - the name of the property returning values to match
      regExExpression - a regular expression to match against
      escape - is the escape character
      Returns:
      expression
    • array

      public static ArrayExpression array()
      Array expression, representing the syntax of "{1, 2, 3}" returning an integer array of 3 elements valued 1, 2, 3.
      Returns:
      expression
    • binaryAnd

      public static BitwiseOpExpression binaryAnd()
      Bitwise (binary) AND.
      Returns:
      expression
    • binaryOr

      public static BitwiseOpExpression binaryOr()
      Bitwise (binary) OR.
      Returns:
      expression
    • binaryXor

      public static BitwiseOpExpression binaryXor()
      Bitwise (binary) XOR.
      Returns:
      expression
    • min

      public static MinRowExpression min(String propertyOne, String propertyTwo, String... moreProperties)
      Minimum value per-row function (not aggregating).
      Parameters:
      propertyOne - the name of a first property to compare
      propertyTwo - the name of a second property to compare
      moreProperties - optional additional properties to compare
      Returns:
      expression
    • min

      public static MinRowExpression min(Expression exprOne, Expression exprTwo, Expression... moreExpressions)
      Minimum value per-row function (not aggregating).
      Parameters:
      exprOne - returns the first value to compare
      exprTwo - returns the second value to compare
      moreExpressions - optional additional values to compare
      Returns:
      expression
    • max

      public static MaxRowExpression max(String propertyOne, String propertyTwo, String... moreProperties)
      Maximum value per-row function (not aggregating).
      Parameters:
      propertyOne - the name of a first property to compare
      propertyTwo - the name of a second property to compare
      moreProperties - optional additional properties to compare
      Returns:
      expression
    • max

      public static MaxRowExpression max(Expression exprOne, Expression exprTwo, Expression... moreExpressions)
      Maximum value per-row function (not aggregating).
      Parameters:
      exprOne - returns the first value to compare
      exprTwo - returns the second value to compare
      moreExpressions - optional additional values to compare
      Returns:
      expression
    • coalesce

      public static CoalesceExpression coalesce(String propertyOne, String propertyTwo, String... moreProperties)
      Coalesce.
      Parameters:
      propertyOne - name of the first property returning value to coealesce
      propertyTwo - name of the second property returning value to coealesce
      moreProperties - name of the optional additional properties returning values to coealesce
      Returns:
      expression
    • coalesce

      public static CoalesceExpression coalesce(Expression exprOne, Expression exprTwo, Expression... moreExpressions)
      Coalesce.
      Parameters:
      exprOne - returns value to coalesce
      exprTwo - returns value to coalesce
      moreExpressions - returning optional additional values to coalesce
      Returns:
      expression
    • constant

      public static ConstantExpression constant(Object value)
      Constant.
      Parameters:
      value - is the constant value
      Returns:
      expression
    • constant

      public static ConstantExpression constant(Object value, Class constantType)
      Constant, use when the value is null.
      Parameters:
      value - is the constant value
      constantType - is the type of the constant
      Returns:
      expression
    • caseWhenThen

      public static CaseWhenThenExpression caseWhenThen()
      Case-when-then expression.
      Returns:
      expression
    • caseSwitch

      public static CaseSwitchExpression caseSwitch(Expression valueToSwitchOn)
      Case-switch expresssion.
      Parameters:
      valueToSwitchOn - provides the switch value
      Returns:
      expression
    • caseSwitch

      public static CaseSwitchExpression caseSwitch(String propertyName)
      Case-switch expresssion.
      Parameters:
      propertyName - the name of the property that provides the switch value
      Returns:
      expression
    • in

      public static InExpression in(String property, Object... values)
      In-expression that is equivalent to the syntax of "property in (value, value, ... value)".
      Parameters:
      property - is the name of the property
      values - are the constants to check against
      Returns:
      expression
    • notIn

      public static InExpression notIn(String property, Object... values)
      Not-In-expression that is equivalent to the syntax of "property not in (value, value, ... value)".
      Parameters:
      property - is the name of the property
      values - are the constants to check against
      Returns:
      expression
    • in

      public static InExpression in(Expression value, Expression... set)
      In-expression that is equivalent to the syntax of "property in (value, value, ... value)".
      Parameters:
      value - provides values to match
      set - are expressons that provide match-against values
      Returns:
      expression
    • notIn

      public static InExpression notIn(Expression value, Expression... set)
      Not-In-expression that is equivalent to the syntax of "property not in (value, value, ... value)".
      Parameters:
      value - provides values to match
      set - are expressons that provide match-against values
      Returns:
      expression
    • not

      public static NotExpression not(Expression inner)
      Not expression negates the sub-expression to the not which is expected to return boolean-typed values.
      Parameters:
      inner - is the sub-expression
      Returns:
      expression
    • staticMethod

      public static StaticMethodExpression staticMethod(String className, String method, Object... parameters)
      Static method invocation.
      Parameters:
      className - the name of the class to invoke a method on
      method - the name of the method to invoke
      parameters - zero, one or more constants that are the parameters to the static method
      Returns:
      expression
    • staticMethod

      public static StaticMethodExpression staticMethod(String className, String method, Expression... parameters)
      Static method invocation.
      Parameters:
      className - the name of the class to invoke a method on
      method - the name of the method to invoke
      parameters - zero, one or more expressions that provide parameters to the static method
      Returns:
      expression
    • prior

      public static PriorExpression prior(int index, String property)
      Prior function.
      Parameters:
      index - the numeric index of the prior event
      property - the name of the property to obtain the value for
      Returns:
      expression
    • previous

      public static PreviousExpression previous(Expression expression, String property)
      Previous function.
      Parameters:
      expression - provides the numeric index of the previous event
      property - the name of the property to obtain the value for
      Returns:
      expression
    • previous

      public static PreviousExpression previous(int index, String property)
      Previous function.
      Parameters:
      index - the numeric index of the previous event
      property - the name of the property to obtain the value for
      Returns:
      expression
    • previousTail

      public static PreviousExpression previousTail(Expression expression, String property)
      Previous tail function.
      Parameters:
      expression - provides the numeric index of the previous event
      property - the name of the property to obtain the value for
      Returns:
      expression
    • previousTail

      public static PreviousExpression previousTail(int index, String property)
      Previous tail function.
      Parameters:
      index - the numeric index of the previous event
      property - the name of the property to obtain the value for
      Returns:
      expression
    • previousCount

      public static PreviousExpression previousCount(String property)
      Previous count function.
      Parameters:
      property - provides the properties or stream name to select for the previous event
      Returns:
      expression
    • previousWindow

      public static PreviousExpression previousWindow(String property)
      Previous window function.
      Parameters:
      property - provides the properties or stream name to select for the previous event
      Returns:
      expression
    • betweenProperty

      public static BetweenExpression betweenProperty(String property, String lowBoundaryProperty, String highBoundaryProperty)
      Between.
      Parameters:
      property - the name of the property supplying data points.
      lowBoundaryProperty - the name of the property supplying lower boundary.
      highBoundaryProperty - the name of the property supplying upper boundary.
      Returns:
      expression
    • between

      public static BetweenExpression between(String property, Object lowBoundary, Object highBoundary)
      Between.
      Parameters:
      property - the name of the property that returns the datapoint to check range
      lowBoundary - constant indicating the lower boundary
      highBoundary - constant indicating the upper boundary
      Returns:
      expression
    • between

      public static BetweenExpression between(Expression datapoint, Expression lowBoundary, Expression highBoundary)
      Between.
      Parameters:
      datapoint - returns the datapoint to check range
      lowBoundary - returns values for the lower boundary
      highBoundary - returns values for the upper boundary
      Returns:
      expression
    • range

      public static BetweenExpression range(Expression datapoint, Expression lowBoundary, Expression highBoundary, boolean isLowIncluded, boolean isHighIncluded)
      Between (or range).
      Parameters:
      datapoint - returns the datapoint to check range
      lowBoundary - returns values for the lower boundary
      highBoundary - returns values for the upper boundary
      isLowIncluded - true to indicate lower boundary itself is included in the range
      isHighIncluded - true to indicate upper boundary itself is included in the range
      Returns:
      expression
    • or

      public static Disjunction or()
      Logical OR disjunction. Use add methods to add expressions.
      Returns:
      expression
    • or

      public static Disjunction or(Expression first, Expression second, Expression... expressions)
      Logical OR disjunction.
      Parameters:
      first - an expression returning values to junction
      second - an expression returning values to junction
      expressions - an optional list of expressions returning values to junction
      Returns:
      expression
    • and

      public static Conjunction and()
      Logical AND conjunction. Use add methods to add expressions.
      Returns:
      expression
    • and

      public static Conjunction and(Expression first, Expression second, Expression... expressions)
      Logical AND conjunction.
      Parameters:
      first - an expression returning values to junction
      second - an expression returning values to junction
      expressions - an optional list of expressions returning values to junction
      Returns:
      expression
    • ge

      public static RelationalOpExpression ge(String propertyName, Object value)
      Greater-or-equal between a property and a constant.
      Parameters:
      propertyName - the name of the property providing left hand side values
      value - is the constant to compare
      Returns:
      expression
    • ge

      public static RelationalOpExpression ge(Expression left, Expression right)
      Greater-or-equals between expression results.
      Parameters:
      left - the expression providing left hand side values
      right - the expression providing right hand side values
      Returns:
      expression
    • geProperty

      public static RelationalOpExpression geProperty(String propertyLeft, String propertyRight)
      Greater-or-equal between properties.
      Parameters:
      propertyLeft - the name of the property providing left hand side values
      propertyRight - the name of the property providing right hand side values
      Returns:
      expression
    • gt

      public static RelationalOpExpression gt(String propertyName, Object value)
      Greater-then between a property and a constant.
      Parameters:
      propertyName - the name of the property providing left hand side values
      value - is the constant to compare
      Returns:
      expression
    • gt

      public static RelationalOpExpression gt(Expression left, Expression right)
      Greater-then between expression results.
      Parameters:
      left - the expression providing left hand side values
      right - the expression providing right hand side values
      Returns:
      expression
    • gtProperty

      public static RelationalOpExpression gtProperty(String propertyLeft, String propertyRight)
      Greater-then between properties.
      Parameters:
      propertyLeft - the name of the property providing left hand side values
      propertyRight - the name of the property providing right hand side values
      Returns:
      expression
    • le

      public static RelationalOpExpression le(String propertyName, Object value)
      Less-or-equals between a property and a constant.
      Parameters:
      propertyName - the name of the property providing left hand side values
      value - is the constant to compare
      Returns:
      expression
    • leProperty

      public static RelationalOpExpression leProperty(String propertyLeft, String propertyRight)
      Less-or-equal between properties.
      Parameters:
      propertyLeft - the name of the property providing left hand side values
      propertyRight - the name of the property providing right hand side values
      Returns:
      expression
    • le

      public static RelationalOpExpression le(Expression left, Expression right)
      Less-or-equal between expression results.
      Parameters:
      left - the expression providing left hand side values
      right - the expression providing right hand side values
      Returns:
      expression
    • lt

      public static RelationalOpExpression lt(String propertyName, Object value)
      Less-then between a property and a constant.
      Parameters:
      propertyName - the name of the property providing left hand side values
      value - is the constant to compare
      Returns:
      expression
    • ltProperty

      public static RelationalOpExpression ltProperty(String propertyLeft, String propertyRight)
      Less-then between properties.
      Parameters:
      propertyLeft - the name of the property providing left hand side values
      propertyRight - the name of the property providing right hand side values
      Returns:
      expression
    • lt

      public static RelationalOpExpression lt(Expression left, Expression right)
      Less-then between expression results.
      Parameters:
      left - the expression providing left hand side values
      right - the expression providing right hand side values
      Returns:
      expression
    • eq

      public static RelationalOpExpression eq(String propertyName, Object value)
      Equals between a property and a constant.
      Parameters:
      propertyName - the name of the property providing left hand side values
      value - is the constant to compare
      Returns:
      expression
    • neq

      public static RelationalOpExpression neq(String propertyName, Object value)
      Not-Equals between a property and a constant.
      Parameters:
      propertyName - the name of the property providing left hand side values
      value - is the constant to compare
      Returns:
      expression
    • eqProperty

      public static RelationalOpExpression eqProperty(String propertyLeft, String propertyRight)
      Equals between properties.
      Parameters:
      propertyLeft - the name of the property providing left hand side values
      propertyRight - the name of the property providing right hand side values
      Returns:
      expression
    • neqProperty

      public static RelationalOpExpression neqProperty(String propertyLeft, String propertyRight)
      Not-Equals between properties.
      Parameters:
      propertyLeft - the name of the property providing left hand side values
      propertyRight - the name of the property providing right hand side values
      Returns:
      expression
    • eq

      public static RelationalOpExpression eq(Expression left, Expression right)
      Equals between expression results.
      Parameters:
      left - the expression providing left hand side values
      right - the expression providing right hand side values
      Returns:
      expression
    • neq

      public static RelationalOpExpression neq(Expression left, Expression right)
      Not-Equals between expression results.
      Parameters:
      left - the expression providing left hand side values
      right - the expression providing right hand side values
      Returns:
      expression
    • isNotNull

      public static RelationalOpExpression isNotNull(String property)
      Not-null test.
      Parameters:
      property - the name of the property supplying the value to check for null
      Returns:
      expression
    • isNotNull

      public static RelationalOpExpression isNotNull(Expression expression)
      Not-null test.
      Parameters:
      expression - supplies the value to check for null
      Returns:
      expression
    • isNull

      public static RelationalOpExpression isNull(String property)
      Is-null test.
      Parameters:
      property - the name of the property supplying the value to check for null
      Returns:
      expression
    • isNull

      public static RelationalOpExpression isNull(Expression expression)
      Is-null test.
      Parameters:
      expression - supplies the value to check for null
      Returns:
      expression
    • property

      public static PropertyValueExpression property(String propertyName)
      Property value.

      An expression that returns the value of the named property.

      Nested, indexed or mapped properties follow the documented sytnax.

      Parameters:
      propertyName - is the name of the property to return the value for.
      Returns:
      expression
    • like

      public static LikeExpression like(String propertyName, String value)
      SQL-Like.
      Parameters:
      propertyName - the name of the property providing values to match
      value - is the string to match against
      Returns:
      expression
    • like

      public static LikeExpression like(Expression left, Expression right)
      SQL-Like.
      Parameters:
      left - provides value to match
      right - provides string to match against
      Returns:
      expression
    • like

      public static LikeExpression like(String propertyName, Object value, String escape)
      SQL-Like.
      Parameters:
      propertyName - the name of the property providing values to match
      value - is the string to match against
      escape - the escape character(s)
      Returns:
      expression
    • like

      public static LikeExpression like(Expression left, Expression right, Expression escape)
      SQL-Like.
      Parameters:
      left - provides value to match
      right - provides string to match against
      escape - the escape character(s)
      Returns:
      expression
    • notLike

      public static LikeExpression notLike(String propertyName, String value)
      SQL-Like negated (not like).
      Parameters:
      propertyName - the name of the property providing values to match
      value - is the string to match against
      Returns:
      expression
    • notLike

      public static LikeExpression notLike(Expression left, Expression right)
      SQL-Like negated (not like).
      Parameters:
      left - provides value to match
      right - provides string to match against
      Returns:
      expression
    • notLike

      public static LikeExpression notLike(String propertyName, Object value, String escape)
      SQL-Like negated (not like).
      Parameters:
      propertyName - the name of the property providing values to match
      value - is the string to match against
      escape - the escape character(s)
      Returns:
      expression
    • notLike

      public static LikeExpression notLike(Expression left, Expression right, Expression escape)
      SQL-Like negated (not like).
      Parameters:
      left - provides value to match
      right - provides string to match against
      escape - the escape character(s)
      Returns:
      expression
    • avg

      public static AvgProjectionExpression avg(String propertyName)
      Average aggregation function.
      Parameters:
      propertyName - name of the property providing the values to aggregate.
      Returns:
      expression
    • avg

      public static AvgProjectionExpression avg(Expression expression)
      Average aggregation function.
      Parameters:
      expression - provides the values to aggregate.
      Returns:
      expression
    • avgDistinct

      public static AvgProjectionExpression avgDistinct(String propertyName)
      Average aggregation function considering distinct values only.
      Parameters:
      propertyName - name of the property providing the values to aggregate.
      Returns:
      expression
    • avgDistinct

      public static AvgProjectionExpression avgDistinct(Expression expression)
      Average aggregation function considering distinct values only.
      Parameters:
      expression - provides the values to aggregate.
      Returns:
      expression
    • median

      public static MedianProjectionExpression median(String propertyName)
      Median aggregation function.
      Parameters:
      propertyName - name of the property providing the values to aggregate.
      Returns:
      expression
    • median

      public static MedianProjectionExpression median(Expression expression)
      Median aggregation function.
      Parameters:
      expression - provides the values to aggregate.
      Returns:
      expression
    • medianDistinct

      public static MedianProjectionExpression medianDistinct(String propertyName)
      Median aggregation function considering distinct values only.
      Parameters:
      propertyName - name of the property providing the values to aggregate.
      Returns:
      expression
    • medianDistinct

      public static MedianProjectionExpression medianDistinct(Expression expression)
      Median aggregation function considering distinct values only.
      Parameters:
      expression - provides the values to aggregate.
      Returns:
      expression
    • stddev

      public static StddevProjectionExpression stddev(String propertyName)
      Standard deviation aggregation function.
      Parameters:
      propertyName - name of the property providing the values to aggregate.
      Returns:
      expression
    • stddev

      public static StddevProjectionExpression stddev(Expression expression)
      Standard deviation aggregation function.
      Parameters:
      expression - provides the values to aggregate.
      Returns:
      expression
    • stddevDistinct

      public static StddevProjectionExpression stddevDistinct(String propertyName)
      Standard deviation function considering distinct values only.
      Parameters:
      propertyName - name of the property providing the values to aggregate.
      Returns:
      expression
    • stddevDistinct

      public static StddevProjectionExpression stddevDistinct(Expression expression)
      Standard deviation function considering distinct values only.
      Parameters:
      expression - provides the values to aggregate.
      Returns:
      expression
    • avedev

      public static AvedevProjectionExpression avedev(String propertyName)
      Mean deviation aggregation function.
      Parameters:
      propertyName - name of the property providing the values to aggregate.
      Returns:
      expression
    • lastEver

      public static LastEverProjectionExpression lastEver(String propertyName)
      Lastever-value aggregation function.
      Parameters:
      propertyName - name of the property providing the values to aggregate.
      Returns:
      expression
    • last

      public static LastProjectionExpression last(String propertyName)
      Lastever-value aggregation function.
      Parameters:
      propertyName - name of the property providing the values to aggregate.
      Returns:
      expression
    • lastEver

      public static LastEverProjectionExpression lastEver(Expression expression)
      Lastever-value aggregation function.
      Parameters:
      expression - provides the values to aggregate.
      Returns:
      expression
    • last

      public static LastProjectionExpression last(Expression expression)
      Lastever-value aggregation function.
      Parameters:
      expression - provides the values to aggregate.
      Returns:
      expression
    • first

      public static FirstProjectionExpression first(String propertyName)
      First-value (windowed) aggregation function.
      Parameters:
      propertyName - name of the property providing the values to aggregate.
      Returns:
      expression
    • firstEver

      public static FirstEverProjectionExpression firstEver(String propertyName)
      First-value (ever) aggregation function.
      Parameters:
      propertyName - name of the property providing the values to aggregate.
      Returns:
      expression
    • first

      public static FirstProjectionExpression first(Expression expression)
      First-value (in window) aggregation function.
      Parameters:
      expression - provides the values to aggregate.
      Returns:
      expression
    • firstEver

      public static FirstEverProjectionExpression firstEver(Expression expression)
      First-value (ever) aggregation function.
      Parameters:
      expression - provides the values to aggregate.
      Returns:
      expression
    • avedev

      public static AvedevProjectionExpression avedev(Expression expression)
      Mean deviation aggregation function.
      Parameters:
      expression - provides the values to aggregate.
      Returns:
      expression
    • avedevDistinct

      public static AvedevProjectionExpression avedevDistinct(String propertyName)
      Mean deviation function considering distinct values only.
      Parameters:
      propertyName - name of the property providing the values to aggregate.
      Returns:
      expression
    • avedevDistinct

      public static AvedevProjectionExpression avedevDistinct(Expression expression)
      Mean deviation function considering distinct values only.
      Parameters:
      expression - provides the values to aggregate.
      Returns:
      expression
    • sum

      public static SumProjectionExpression sum(String propertyName)
      Sum aggregation function.
      Parameters:
      propertyName - name of the property providing the values to aggregate.
      Returns:
      expression
    • sum

      public static SumProjectionExpression sum(Expression expression)
      Sum aggregation function.
      Parameters:
      expression - provides the values to aggregate.
      Returns:
      expression
    • sumDistinct

      public static SumProjectionExpression sumDistinct(String propertyName)
      Sum aggregation function considering distinct values only.
      Parameters:
      propertyName - name of the property providing the values to aggregate.
      Returns:
      expression
    • sumDistinct

      public static SumProjectionExpression sumDistinct(Expression expression)
      Sum aggregation function considering distinct values only.
      Parameters:
      expression - provides the values to aggregate.
      Returns:
      expression
    • countStar

      public static CountStarProjectionExpression countStar()
      Count aggregation function not counting values, equivalent to "count(*)".
      Returns:
      expression
    • count

      public static CountProjectionExpression count(String propertyName)
      Count aggregation function.
      Parameters:
      propertyName - name of the property providing the values to count.
      Returns:
      expression
    • count

      public static CountProjectionExpression count(Expression expression)
      Count aggregation function.
      Parameters:
      expression - provides the values to count.
      Returns:
      expression
    • countDistinct

      public static CountProjectionExpression countDistinct(String propertyName)
      Count aggregation function considering distinct values only.
      Parameters:
      propertyName - name of the property providing the values to count.
      Returns:
      expression
    • countDistinct

      public static CountProjectionExpression countDistinct(Expression expression)
      Count aggregation function considering distinct values only.
      Parameters:
      expression - provides the values to count.
      Returns:
      expression
    • min

      public static MinProjectionExpression min(String propertyName)
      Minimum aggregation function.
      Parameters:
      propertyName - name of the property providing the values to aggregate.
      Returns:
      expression
    • min

      public static MinProjectionExpression min(Expression expression)
      Minimum aggregation function.
      Parameters:
      expression - provides the values to aggregate.
      Returns:
      expression
    • minDistinct

      public static MinProjectionExpression minDistinct(String propertyName)
      Minimum aggregation function considering distinct values only.
      Parameters:
      propertyName - name of the property providing the values to aggregate.
      Returns:
      expression
    • minDistinct

      public static MinProjectionExpression minDistinct(Expression expression)
      Minimum aggregation function considering distinct values only.
      Parameters:
      expression - provides the values to aggregate.
      Returns:
      expression
    • max

      public static MaxProjectionExpression max(String propertyName)
      Maximum aggregation function.
      Parameters:
      propertyName - name of the property providing the values to aggregate.
      Returns:
      expression
    • max

      public static MaxProjectionExpression max(Expression expression)
      Maximum aggregation function.
      Parameters:
      expression - provides the values to aggregate.
      Returns:
      expression
    • maxDistinct

      public static MaxProjectionExpression maxDistinct(String propertyName)
      Maximum aggregation function considering distinct values only.
      Parameters:
      propertyName - name of the property providing the values to aggregate.
      Returns:
      expression
    • maxDistinct

      public static MaxProjectionExpression maxDistinct(Expression expression)
      Maximum aggregation function considering distinct values only.
      Parameters:
      expression - provides the values to aggregate.
      Returns:
      expression
    • modulo

      public static ArithmaticExpression modulo(Expression left, Expression right)
      Modulo.
      Parameters:
      left - the expression providing left hand values
      right - the expression providing right hand values
      Returns:
      expression
    • modulo

      public static ArithmaticExpression modulo(String propertyLeft, String propertyRight)
      Modulo.
      Parameters:
      propertyLeft - the name of the property providing left hand values
      propertyRight - the name of the property providing right hand values
      Returns:
      expression
    • minus

      public static ArithmaticExpression minus(Expression left, Expression right)
      Subtraction.
      Parameters:
      left - the expression providing left hand values
      right - the expression providing right hand values
      Returns:
      expression
    • minus

      public static ArithmaticExpression minus(String propertyLeft, String propertyRight)
      Subtraction.
      Parameters:
      propertyLeft - the name of the property providing left hand values
      propertyRight - the name of the property providing right hand values
      Returns:
      expression
    • plus

      public static ArithmaticExpression plus(Expression left, Expression right)
      Addition.
      Parameters:
      left - the expression providing left hand values
      right - the expression providing right hand values
      Returns:
      expression
    • plus

      public static ArithmaticExpression plus(String propertyLeft, String propertyRight)
      Addition.
      Parameters:
      propertyLeft - the name of the property providing left hand values
      propertyRight - the name of the property providing right hand values
      Returns:
      expression
    • multiply

      public static ArithmaticExpression multiply(Expression left, Expression right)
      Multiplication.
      Parameters:
      left - the expression providing left hand values
      right - the expression providing right hand values
      Returns:
      expression
    • multiply

      public static ArithmaticExpression multiply(String propertyLeft, String propertyRight)
      Multiplication.
      Parameters:
      propertyLeft - the name of the property providing left hand values
      propertyRight - the name of the property providing right hand values
      Returns:
      expression
    • divide

      public static ArithmaticExpression divide(Expression left, Expression right)
      Division.
      Parameters:
      left - the expression providing left hand values
      right - the expression providing right hand values
      Returns:
      expression
    • divide

      public static ArithmaticExpression divide(String propertyLeft, String propertyRight)
      Division.
      Parameters:
      propertyLeft - the name of the property providing left hand values
      propertyRight - the name of the property providing right hand values
      Returns:
      expression
    • concat

      public static ConcatExpression concat(String property, String... properties)
      Concatenation.
      Parameters:
      property - the name of property returning values to concatenate
      properties - the names of additional properties returning values to concatenate
      Returns:
      expression
    • subquery

      public static SubqueryExpression subquery(EPStatementObjectModel model)
      Subquery.
      Parameters:
      model - is the object model of the lookup
      Returns:
      expression
    • subqueryIn

      public static SubqueryInExpression subqueryIn(String property, EPStatementObjectModel model)
      Subquery with in-clause, represents the syntax of "value in (select ... from ...)".
      Parameters:
      property - is the name of the property that returns the value to match against the values returned by the lookup
      model - is the object model of the lookup
      Returns:
      expression
    • subqueryNotIn

      public static SubqueryInExpression subqueryNotIn(String property, EPStatementObjectModel model)
      Subquery with not-in-clause, represents the syntax of "value not in (select ... from ...)".
      Parameters:
      property - is the name of the property that returns the value to match against the values returned by the lookup
      model - is the object model of the lookup
      Returns:
      expression
    • subqueryExists

      public static SubqueryExistsExpression subqueryExists(EPStatementObjectModel model)
      Subquery with exists-clause, represents the syntax of "select * from ... where exists (select ... from ...)".
      Parameters:
      model - is the object model of the lookup
      Returns:
      expression
    • subqueryIn

      public static SubqueryInExpression subqueryIn(Expression expression, EPStatementObjectModel model)
      Subquery with in-clause, represents the syntax of "value in (select ... from ...)".
      Parameters:
      expression - returns the value to match against the values returned by the lookup
      model - is the object model of the lookup
      Returns:
      expression
    • subqueryNotIn

      public static SubqueryInExpression subqueryNotIn(Expression expression, EPStatementObjectModel model)
      Subquery with not-in-clause, represents the syntax of "value not in (select ... from ...)".
      Parameters:
      expression - returns the value to match against the values returned by the lookup
      model - is the object model of the lookup
      Returns:
      expression
    • timePeriod

      public static TimePeriodExpression timePeriod(Double days, Double hours, Double minutes, Double seconds, Double milliseconds)
      Returns a time period expression for the specified parts.

      Each part can be a null value in which case the part is left out.

      Parameters:
      days - day part
      hours - hour part
      minutes - minute part
      seconds - seconds part
      milliseconds - milliseconds part
      Returns:
      time period expression
    • timePeriod

      public static TimePeriodExpression timePeriod(Object days, Object hours, Object minutes, Object seconds, Object milliseconds)
      Returns a time period expression for the specified parts.

      Each part can be a null value in which case the part is left out.

      Each object value may be a String value for an event property, or a number for a constant.

      Parameters:
      days - day part
      hours - hour part
      minutes - minute part
      seconds - seconds part
      milliseconds - milliseconds part
      Returns:
      time period expression
    • crontabScheduleWildcard

      public static CrontabParameterExpression crontabScheduleWildcard()
      Creates a wildcard parameter.
      Returns:
      parameter
    • crontabScheduleItem

      public static CrontabParameterExpression crontabScheduleItem(Integer parameter, ScheduleItemType type)
      Creates a parameter of the given type and parameterized by a number.
      Parameters:
      parameter - the constant parameter for the type
      type - the type of crontab parameter
      Returns:
      crontab parameter
    • crontabScheduleFrequency

      public static CrontabFrequencyExpression crontabScheduleFrequency(int frequency)
      Creates a frequency cron parameter.
      Parameters:
      frequency - the constant for the frequency
      Returns:
      cron parameter
    • crontabScheduleRange

      public static CrontabRangeExpression crontabScheduleRange(int lowerBounds, int upperBounds)
      Creates a range cron parameter.
      Parameters:
      lowerBounds - the lower bounds
      upperBounds - the upper bounds
      Returns:
      crontab parameter
    • toPropertyExpressions

      protected static List<PropertyValueExpression> toPropertyExpressions(String... properties)
      Returns a list of expressions returning property values for the property names passed in.
      Parameters:
      properties - is a list of property names
      Returns:
      list of property value expressions
    • getPropExpr

      protected static PropertyValueExpression getPropExpr(String propertyName)
      Returns an expression returning the propertyName value for the propertyName name passed in.
      Parameters:
      propertyName - the name of the property returning property values
      Returns:
      expression