Class BooleanExpression

java.lang.Object
com.google.cloud.firestore.pipeline.expressions.Expression
com.google.cloud.firestore.pipeline.expressions.BooleanExpression

@BetaApi public abstract class BooleanExpression extends Expression
  • Method Details

    • countIf

      @BetaApi public AggregateFunction countIf()
      Creates an aggregation that counts the number of stage inputs where the this boolean expression evaluates to true.
      Returns:
      A new AggregateFunction representing the count aggregation.
    • conditional

      @BetaApi 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:
      thenExpr - The expression to evaluate if the condition is true.
      elseExpr - The expression to evaluate if the condition is false.
      Returns:
      A new Expression representing the conditional operation.
    • conditional

      @BetaApi 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:
      thenValue - Value if the condition is true.
      elseValue - Value if the condition is false.
      Returns:
      A new Expression representing the conditional operation.
    • ifError

      @BetaApi 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.
      Parameters:
      catchExpr - The catch expression that will be evaluated and returned if the this expression produces an error.
      Returns:
      A new Expression representing the ifError operation.
    • not

      @BetaApi public final BooleanExpression not()
      Creates an expression that negates this boolean expression.
      Returns:
      A new BooleanExpression representing the not operation.
    • rawFunction

      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 - The name of the raw function.
      params - The expressions to be passed as arguments to the function.
      Returns:
      A new [BooleanExpression] representing the raw function.