Class CaseSwitchExpression
java.lang.Object
com.espertech.esper.common.client.soda.ExpressionBase
com.espertech.esper.common.client.soda.CaseSwitchExpression
- All Implemented Interfaces:
Expression
,Serializable
Case-expression that acts as a switch testing a value against other values.
The first child expression provides the value to switch on. The following pairs of child expressions provide the "when expression then expression" results. The last child expression provides the "else" result.
- See Also:
-
Constructor Summary
ConstructorDescriptionCtor - for use to create an expression tree, without inner expressionCaseSwitchExpression
(Expression switchValue) Ctor. -
Method Summary
Modifier and TypeMethodDescriptionadd
(Expression when, Expression then) Adds a pair of expressions representing a "when" and a "then" in the switch.Returns precedence.setElse
(Expression elseExpr) Sets the else-part of the case-switch.void
toPrecedenceFreeEPL
(StringWriter writer) Renders the expressions and all it's child expression, in full tree depth, as a string in language syntax.Methods inherited from class com.espertech.esper.common.client.soda.ExpressionBase
addChild, getChildren, getTreeObjectName, renderAggregation, setChildren, setTreeObjectName, toEPL, toPrecedenceFreeEPL, toPrecedenceFreeEPL
-
Constructor Details
-
CaseSwitchExpression
public CaseSwitchExpression()Ctor - for use to create an expression tree, without inner expression -
CaseSwitchExpression
Ctor.- Parameters:
switchValue
- is the expression providing the value to switch on
-
-
Method Details
-
add
Adds a pair of expressions representing a "when" and a "then" in the switch.- Parameters:
when
- expression to match onthen
- expression to return a conditional result when the when-expression matches- Returns:
- expression
-
setElse
Sets the else-part of the case-switch. This result of this expression is returned when no when-expression matched.- Parameters:
elseExpr
- is the expression returning the no-match value- Returns:
- expression
-
getPrecedence
Description copied from interface:Expression
Returns precedence.- Returns:
- precedence
-
toPrecedenceFreeEPL
Description copied from class:ExpressionBase
Renders the expressions and all it's child expression, in full tree depth, as a string in language syntax.- Specified by:
toPrecedenceFreeEPL
in classExpressionBase
- Parameters:
writer
- is the output to use
-