Package com.sap.cds.ql.cqn
Interface CqnLiteral<T>
- All Superinterfaces:
CqnToken,CqnValue,JSONizable
- All Known Subinterfaces:
BooleanValue,CqnBooleanLiteral,CqnNumericLiteral<N>,CqnStringLiteral,CqnStructuredLiteral,CqnTemporalLiteral<E>,Literal<T>
A CQN literal value of type
CqnLiteral. Use value() to get the value.-
Method Summary
Modifier and TypeMethodDescriptiondefault CqnBooleanLiteralCasts this literal toCqnBooleanLiteral.default CqnLiteral<?>Casts this value toCqnLiteral.default CqnNumericLiteral<?>asNumber()Casts this literal toCqnNumericLiteral.default CqnStringLiteralasString()Casts this literal toCqnStringLiteral.default CqnStructuredLiteralCasts this literal toCqnStructuredLiteral.default CqnTemporalLiteral<?>Casts this literal toCqnTemporalLiteral.default booleanReturnstrueif this is aCqnBooleanLiteral.default booleanSpecifies if thisCqnLiteralshould be handled as a constant value during query execution.default booleanReturnstrueif this is aCqnLiteral.default booleanReturnstrueif this is aCqnNumericLiteral.default booleanisString()Returnstrueif this is aCqnStringLiteral.default booleanReturnstrueif this is aCqnStructuredLiteral.default booleanReturnstrueif this is aCqnTemporalLiteral.value()Returns the literal value.Methods inherited from interface com.sap.cds.ql.cqn.CqnValue
as, asExpression, asFunction, asList, asNullValue, asParameter, asPlain, asRef, isExpression, isFunction, isList, isNullValue, isParameter, isPlain, isRef, ofRef, typeMethods inherited from interface com.sap.cds.JSONizable
toJson
-
Method Details
-
value
T value()Returns the literal value.- Returns:
- the literal value
-
isConstant
default boolean isConstant()Specifies if thisCqnLiteralshould be handled as a constant value during query execution.- Returns:
- true if the literal can be handled as a constant value
-
asLiteral
Description copied from interface:CqnValueCasts this value toCqnLiteral. -
isLiteral
default boolean isLiteral()Description copied from interface:CqnValueReturnstrueif this is aCqnLiteral. -
isBoolean
default boolean isBoolean()Returnstrueif this is aCqnBooleanLiteral.- Returns:
trueif this is a boolean literal, otherwisefalse
-
isNumeric
default boolean isNumeric()Returnstrueif this is aCqnNumericLiteral.- Returns:
trueif this is a numeric literal, otherwisefalse
-
isString
default boolean isString()Returnstrueif this is aCqnStringLiteral.- Returns:
trueif this is a string literal, otherwisefalse
-
isTemporal
default boolean isTemporal()Returnstrueif this is aCqnTemporalLiteral.- Returns:
trueif this is a temporal literal, otherwisefalse
-
isStructured
default boolean isStructured()Returnstrueif this is aCqnStructuredLiteral.- Returns:
trueif this is a structured literal, otherwisefalse
-
asBoolean
Casts this literal toCqnBooleanLiteral.- Returns:
- this literal as a boolean literal
- Throws:
ClassCastException- if this literal is not boolean
-
asString
Casts this literal toCqnStringLiteral.- Returns:
- this literal as a string literal
- Throws:
ClassCastException- if this literal is not a string literal
-
asNumber
Casts this literal toCqnNumericLiteral.- Returns:
- this literal as a numeric literal
- Throws:
ClassCastException- if this literal is not numeric
-
asTemporal
Casts this literal toCqnTemporalLiteral.- Returns:
- this literal as a temporal literal
- Throws:
ClassCastException- if this literal is not temporal
-
asStructured
Casts this literal toCqnStructuredLiteral.- Returns:
- this literal as a structured literal
- Throws:
ClassCastException- if this literal is not structured
-