public abstract class BooleanExpression extends ExpressionStatic Methods
rawFunction(String name, Expression[] params)
public static BooleanExpression rawFunction(String name, Expression[] params)Creates a 'raw' boolean function expression. This is useful if the expression is available in the backend, but not yet in the current version of the SDK yet.
| Parameters | |
|---|---|
| Name | Description |
name |
StringThe name of the raw function. |
params |
Expression[]The expressions to be passed as arguments to the function. |
| Returns | |
|---|---|
| Type | Description |
BooleanExpression |
A new [BooleanExpression] representing the raw function. |
Methods
conditional(Expression thenExpr, Expression elseExpr)
public final Expression conditional(Expression thenExpr, Expression elseExpr)Creates a conditional expression that evaluates to a thenExpr expression if this
condition is true or an elseExpr expression if the condition is false.
| Parameters | |
|---|---|
| Name | Description |
thenExpr |
ExpressionThe expression to evaluate if the condition is true. |
elseExpr |
ExpressionThe expression to evaluate if the condition is false. |
| Returns | |
|---|---|
| Type | Description |
Expression |
A new Expression representing the conditional operation. |
conditional(Object thenValue, Object elseValue)
public final Expression conditional(Object thenValue, Object elseValue)Creates a conditional expression that evaluates to a thenValue if this condition is
true or an elseValue if the condition is false.
| Parameters | |
|---|---|
| Name | Description |
thenValue |
ObjectValue if the condition is true. |
elseValue |
ObjectValue if the condition is false. |
| Returns | |
|---|---|
| Type | Description |
Expression |
A new Expression representing the conditional operation. |
countIf()
public AggregateFunction countIf()Creates an aggregation that counts the number of stage inputs where the this boolean expression evaluates to true.
| Returns | |
|---|---|
| Type | Description |
AggregateFunction |
A new AggregateFunction representing the count aggregation. |
ifError(BooleanExpression catchExpr)
public final BooleanExpression ifError(BooleanExpression catchExpr)Creates an expression that returns the catchExpr argument if there is an error, else
return the result of this expression.
| Parameter | |
|---|---|
| Name | Description |
catchExpr |
BooleanExpressionThe catch expression that will be evaluated and returned if the this expression produces an error. |
| Returns | |
|---|---|
| Type | Description |
BooleanExpression |
A new Expression representing the ifError operation. |
not()
public final BooleanExpression not()Creates an expression that negates this boolean expression.
| Returns | |
|---|---|
| Type | Description |
BooleanExpression |
A new BooleanExpression representing the not operation. |