EntityT
- VdmObject that the expression is operating on.public class ExpressionFluentHelper<EntityT> extends FilterExpressionHelper<EntityT>
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.not(ExpressionFluentHelper)
Constructor and Description |
---|
ExpressionFluentHelper(FilterExpressionWrapper<?> expression) |
Modifier and Type | Method and Description |
---|---|
ExpressionFluentHelper<EntityT> |
and(ExpressionFluentHelper<EntityT> conjunctExpression)
Boolean AND expression fluent helper.
|
protected boolean |
canEqual(Object other) |
boolean |
equals(Object o) |
List<com.sap.cloud.sdk.datamodel.odata.helper.ExpressionFluentHelper.LogicPair> |
getChain() |
FilterExpressionWrapper<?> |
getExpression() |
int |
hashCode() |
boolean |
isNegateOperator() |
ExpressionFluentHelper<EntityT> |
not()
Boolean NOT expression fluent helper.
|
static <T> ExpressionFluentHelper<T> |
not(ExpressionFluentHelper<T> expression)
Boolean NOT expression fluent helper.
|
ExpressionFluentHelper<EntityT> |
or(ExpressionFluentHelper<EntityT> disjunctExpression)
Boolean OR expression fluent helper.
|
String |
toString() |
public ExpressionFluentHelper(FilterExpressionWrapper<?> expression)
@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)
disjunctExpression
- Other expression to combine with.@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)
conjunctExpression
- Other expression to combine with.@Nonnull public ExpressionFluentHelper<EntityT> not()
@Nonnull public static <T> ExpressionFluentHelper<T> not(@Nonnull ExpressionFluentHelper<T> expression)
T
- The type argument for the returned ExpressionFluentHelper
expression
- expression to be negated.protected boolean canEqual(Object other)
public List<com.sap.cloud.sdk.datamodel.odata.helper.ExpressionFluentHelper.LogicPair> getChain()
public FilterExpressionWrapper<?> getExpression()
public boolean isNegateOperator()
Copyright © 2020 SAP SE. All rights reserved.