Package com.sap.cds.ql.cqn
Interface CqnInPredicate
- All Superinterfaces:
CqnExpression
,CqnPredicate
,CqnToken
,CqnValue
,JSONizable
- All Known Subinterfaces:
CqnEtagPredicate
The
in
predicate tests wether an actual value
is
equal to any value from a defined value set
.
It evaluates to false
if the value set is empty.-
Method Summary
Modifier and TypeMethodDescriptiondefault void
accept
(CqnVisitor visitor) Traverses the expression tree represented by this token with a givenvisitor
.value()
The actualCqnValue
that is tested against the values given byvalueSet()
.default Collection<CqnValue>
values()
Returns the collection of expected values in casevalueSet()
is aCqnListValue
, otherwise aClassCastException
is thrown.valueSet()
Defines the set of expected values theactual value
is tested against.Methods inherited from interface com.sap.cds.ql.cqn.CqnExpression
asArithmeticExpression, asCaseExpression, asExpression, asNegation, isArithmeticExpression, isCaseExpression, isExpression, isNegation, toJson
Methods inherited from interface com.sap.cds.ql.cqn.CqnPredicate
asPredicate, isPredicate
Methods inherited from interface com.sap.cds.ql.cqn.CqnValue
as, asFunction, asList, asLiteral, asNullValue, asParameter, asPlain, asRef, isFunction, isList, isLiteral, isNullValue, isParameter, isPlain, isRef, ofLiteral, ofRef, type
-
Method Details
-
value
CqnValue value()The actualCqnValue
that is tested against the values given byvalueSet()
.- Returns:
- the actual
CqnValue
-
values
Returns the collection of expected values in casevalueSet()
is aCqnListValue
, otherwise aClassCastException
is thrown.- Returns:
- the expected values
- Throws:
ClassCastException
- if this value is not aCqnListValue
-
valueSet
CqnValue valueSet()Defines the set of expected values theactual value
is tested against. The returnedCqnValue
can either be aCqnListValue
containing all expected values, aCqnReference
pointing to a collection-valued element, or aCqnParameter
pointing to a collection of values.- Returns:
- the set of expected values
-
accept
Description copied from interface:CqnToken
Traverses the expression tree represented by this token with a givenvisitor
. The traversal order is depth-first. If this token has child nodes they are traversed first by dispatching the visitor to the children'saccept
methods. Afterwards this token is passed to the visitor'svisit
method specific for this token's type.- Specified by:
accept
in interfaceCqnExpression
- Specified by:
accept
in interfaceCqnToken
- Parameters:
visitor
- theCqnVisitor
-