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>
,CqnVector
,Literal<T>
A CQN literal value of type
CqnLiteral
. Use value()
to get the value.-
Method Summary
Modifier and TypeMethodDescriptiondefault CqnBooleanLiteral
Casts this literal toCqnBooleanLiteral
.default CqnLiteral<?>
Casts this value toCqnLiteral
.default CqnNumericLiteral<?>
asNumber()
Casts this literal toCqnNumericLiteral
.default CqnStringLiteral
asString()
Casts this literal toCqnStringLiteral
.default CqnStructuredLiteral
Casts this literal toCqnStructuredLiteral
.default CqnTemporalLiteral<?>
Casts this literal toCqnTemporalLiteral
.default CqnVector
asVector()
Casts this literal toCqnVector
.default boolean
Returnstrue
if this is aCqnBooleanLiteral
.default boolean
Specifies if thisCqnLiteral
should be handled as a constant value during query execution.default boolean
Returnstrue
if this is aCqnLiteral
.default boolean
Returnstrue
if this is aCqnNumericLiteral
.default boolean
isString()
Returnstrue
if this is aCqnStringLiteral
.default boolean
Returnstrue
if this is aCqnStructuredLiteral
.default boolean
Returnstrue
if this is aCqnTemporalLiteral
.default boolean
isVector()
Returnstrue
if this is aCqnVector
.default Stream<CqnLiteral<?>>
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, type
Methods 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 thisCqnLiteral
should 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:CqnValue
Casts this value toCqnLiteral
. -
isLiteral
default boolean isLiteral()Description copied from interface:CqnValue
Returnstrue
if this is aCqnLiteral
. -
ofLiteral
-
isBoolean
default boolean isBoolean()Returnstrue
if this is aCqnBooleanLiteral
.- Returns:
true
if this is a boolean literal, otherwisefalse
-
isNumeric
default boolean isNumeric()Returnstrue
if this is aCqnNumericLiteral
.- Returns:
true
if this is a numeric literal, otherwisefalse
-
isString
default boolean isString()Returnstrue
if this is aCqnStringLiteral
.- Returns:
true
if this is a string literal, otherwisefalse
-
isTemporal
default boolean isTemporal()Returnstrue
if this is aCqnTemporalLiteral
.- Returns:
true
if this is a temporal literal, otherwisefalse
-
isStructured
default boolean isStructured()Returnstrue
if this is aCqnStructuredLiteral
.- Returns:
true
if this is a structured literal, otherwisefalse
-
isVector
@Beta default boolean isVector()Returnstrue
if this is aCqnVector
.- Returns:
true
if this is a vector, 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
-
asVector
Casts this literal toCqnVector
.- Returns:
- this literal as a vector
- Throws:
ClassCastException
- if this literal is no vector
-