Class ExpressionFluentHelper<EntityT>

java.lang.Object
com.sap.cloud.sdk.datamodel.odata.helper.ExpressionFluentHelper<EntityT>
Type Parameters:
EntityT - VdmObject that the expression is operating on.

public class ExpressionFluentHelper<EntityT> extends Object
Template class that represents query expressions. Instances of this object are used in query modifier methods of the entity fluent helpers. Use either the expression methods from EntityField instances, or the logical operators and and or as methods in this class. Negation can be achieved by not. Every logical operator creates and returns a new instance based on the original expression object. Instantiating objects from this class directly can cause undefined results.
See Also:
  • Constructor Details

    • ExpressionFluentHelper

      public ExpressionFluentHelper(@Nonnull ValueBoolean delegateExpression)
      Creates a new helper based on an arbitrary, untyped filter expression.

      Instances of this class can be used to pass an unchecked ValueBoolean to fluent helpers. This approach discards type safety and is generally discouraged.

      Parameters:
      delegateExpression - The expression to delegate to.
  • Method Details

    • or

      @Nonnull public ExpressionFluentHelper<EntityT> or(@Nonnull ExpressionFluentHelper<EntityT> disjunctExpression)

      Boolean OR expression fluent helper.

      Please note:
      Filter expressions chained together by logical operators are interpreted in the same order as their corresponding methods are called. Since the Java language evaluates method calls from left to right, the fluent API design is following the same principle. The implicit precedence is following the method invocation and not the underlying, logical operators:

           A.or(B).and(C) <=> (A.or(B)).and(C)
       

      Recommendation:
      Incorporate parentheses or introduce variables to reflect combined expressions:

           var AorB = A.or(B)
           AorB.and(C)
       

      Parameters:
      disjunctExpression - Other expression to combine with.
      Returns:
      Fluent helper that represents a ((this) || other) expression.
    • and

      @Nonnull public ExpressionFluentHelper<EntityT> and(@Nonnull ExpressionFluentHelper<EntityT> conjunctExpression)

      Boolean AND expression fluent helper.

      Please note:
      Filter expressions chained together by logical operators are interpreted in the same order as their corresponding methods are called. Since the Java language evaluates method calls from left to right, the fluent API design is following the same principle. The implicit precedence is following the method invocation and not the underlying, logical operators:

           A.or(B).and(C) <=> (A.or(B)).and(C)
       

      Recommendation:
      Incorporate parentheses or introduce variables to reflect combined expressions:

           var AorB = A.or(B)
           AorB.and(C)
       

      Parameters:
      conjunctExpression - Other expression to combine with.
      Returns:
      Fluent helper that represents a ((this) && other) expression.
    • not

      @Nonnull public ExpressionFluentHelper<EntityT> not()
      Boolean NOT expression fluent helper.
      Returns:
      Fluent helper that represents a not(this) expression.
    • not

      @Nonnull public static <T> ExpressionFluentHelper<T> not(@Nonnull ExpressionFluentHelper<T> expression)
      Boolean NOT expression fluent helper.
      Type Parameters:
      T - The type argument for the returned ExpressionFluentHelper
      Parameters:
      expression - expression to be negated.
      Returns:
      Fluent helper that represents a not(expression) expression.