Package com.sap.cds.ql.cqn
Interface CqnValue
-
- All Superinterfaces:
CqnToken
,JSONizable
- All Known Subinterfaces:
BooleanFunction
,CqnArithmeticExpression
,CqnArithmeticNegation
,CqnBooleanLiteral
,CqnComparisonPredicate
,CqnConnectivePredicate
,CqnContainmentTest
,CqnElementRef
,CqnExistsSubquery
,CqnExpression
,CqnFunc
,CqnInPredicate
,CqnListValue
,CqnLiteral<T>
,CqnMatchPredicate
,CqnNegation
,CqnNullValue
,CqnNumericLiteral<N>
,CqnParameter
,CqnPlain
,CqnPredicate
,CqnSearchPredicate
,CqnStringLiteral
,CqnStructuredLiteral
,CqnTemporalLiteral<E>
,ElementRef<T>
,FunctionCall<T>
,Literal<T>
,Parameter<T>
,Predicate
,Value<T>
public interface CqnValue extends CqnToken
-
-
Method Summary
All Methods Instance Methods Default Methods Modifier and Type Method Description default <T extends CqnValue>
Tas(Class<T> type)
Casts this type to the giventype
.default CqnExpression
asExpression()
Casts this value toCqnExpression
.default CqnFunc
asFunction()
Casts this value toCqnFunc
.default CqnListValue
asList()
Casts this value toCqnListValue
.default CqnLiteral<?>
asLiteral()
Casts this value toCqnLiteral
.default CqnNullValue
asNullValue()
Casts this value toCqnNullValue
.default CqnParameter
asParameter()
Casts this value toCqnParameter
.default CqnPlain
asPlain()
Casts this value toCqnPlain
.default CqnElementRef
asRef()
Casts this value toCqnElementRef
.default boolean
isExpression()
Returnstrue
if this is aCqnExpression
.default boolean
isFunction()
Returnstrue
if this is aCqnFunc
.default boolean
isList()
Returnstrue
if this is aCqnListValue
value.default boolean
isLiteral()
Returnstrue
if this is aCqnLiteral
.default boolean
isNullValue()
Returnstrue
if this is aCqnNullValue
.default boolean
isParameter()
Returnstrue
if this is aCqnParameter
.default boolean
isPlain()
Returnstrue
if this is aCqnPlain
value.default boolean
isRef()
Returnstrue
if this is aCqnElementRef
.default Stream<CqnElementRef>
ofRef()
default Optional<String>
type()
Returns the optional CDS type of this value.-
Methods inherited from interface com.sap.cds.JSONizable
toJson
-
-
-
-
Method Detail
-
type
default Optional<String> type()
Returns the optional CDS type of this value.- Returns:
- the optional CDS type
-
isRef
default boolean isRef()
Returnstrue
if this is aCqnElementRef
.- Returns:
true
if this is an element ref, otherwisefalse
-
isExpression
default boolean isExpression()
Returnstrue
if this is aCqnExpression
.- Returns:
true
if this is an expression, otherwisefalse
-
isFunction
default boolean isFunction()
Returnstrue
if this is aCqnFunc
.- Returns:
true
if this is a function, otherwisefalse
-
isLiteral
default boolean isLiteral()
Returnstrue
if this is aCqnLiteral
.- Returns:
true
if this is a literal, otherwisefalse
-
isNullValue
default boolean isNullValue()
Returnstrue
if this is aCqnNullValue
.- Returns:
true
if this is a null value, otherwisefalse
-
isParameter
default boolean isParameter()
Returnstrue
if this is aCqnParameter
.- Returns:
true
if this is a parameter, otherwisefalse
-
isPlain
default boolean isPlain()
Returnstrue
if this is aCqnPlain
value.- Returns:
true
if this is a plain value, otherwisefalse
-
isList
default boolean isList()
Returnstrue
if this is aCqnListValue
value.- Returns:
true
if this is a list value, otherwisefalse
-
asRef
default CqnElementRef asRef()
Casts this value toCqnElementRef
.- Returns:
- this value as an element ref
- Throws:
ClassCastException
- if this value is not an element ref
-
ofRef
default Stream<CqnElementRef> ofRef()
-
asExpression
default CqnExpression asExpression()
Casts this value toCqnExpression
.- Returns:
- this value as an expression
- Throws:
ClassCastException
- if this value is not an expression
-
asFunction
default CqnFunc asFunction()
Casts this value toCqnFunc
.- Returns:
- this value as a function
- Throws:
ClassCastException
- if this value is not a function
-
asLiteral
default CqnLiteral<?> asLiteral()
Casts this value toCqnLiteral
.- Returns:
- this value as a literal
- Throws:
ClassCastException
- if this value is not a literal
-
asNullValue
default CqnNullValue asNullValue()
Casts this value toCqnNullValue
.- Returns:
- this value as a null value
- Throws:
ClassCastException
- if this value is not a null value
-
asParameter
default CqnParameter asParameter()
Casts this value toCqnParameter
.- Returns:
- this value as a parameter
- Throws:
ClassCastException
- if this value is not a parameter
-
asPlain
default CqnPlain asPlain()
Casts this value toCqnPlain
.- Returns:
- this value as a plain value
- Throws:
ClassCastException
- if this value is not a plain value
-
asList
default CqnListValue asList()
Casts this value toCqnListValue
.- Returns:
- this value as a list value
- Throws:
ClassCastException
- if this value is not a list value
-
-