Package com.sap.cds.ql.cqn
Interface CqnLiteral<T>
-
- All Superinterfaces:
CqnToken
,CqnValue
,JSONizable
- All Known Subinterfaces:
CqnBooleanLiteral
,CqnNumericLiteral<N>
,CqnStringLiteral
,CqnStructuredLiteral
,CqnTemporalLiteral<E>
,Literal<T>
public interface CqnLiteral<T> extends CqnValue
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default CqnBooleanLiteral
asBoolean()
Casts this literal toCqnBooleanLiteral
.default CqnLiteral<?>
asLiteral()
Casts this value toCqnLiteral
.default CqnNumericLiteral<?>
asNumber()
Casts this literal toCqnNumericLiteral
.default CqnStringLiteral
asString()
Casts this literal toCqnStringLiteral
.default CqnStructuredLiteral
asStructured()
Casts this literal toCqnStructuredLiteral
.default CqnTemporalLiteral<?>
asTemporal()
Casts this literal toCqnTemporalLiteral
.default boolean
isBoolean()
Returnstrue
if this is aCqnBooleanLiteral
.default boolean
isConstant()
Defines if theCqnLiteral
can be handled as a constant value during query execution.default boolean
isLiteral()
Returnstrue
if this is aCqnLiteral
.default boolean
isNumeric()
Returnstrue
if this is aCqnNumericLiteral
.default boolean
isString()
Returnstrue
if this is aCqnStringLiteral
.default boolean
isStructured()
Returnstrue
if this is aCqnStructuredLiteral
.default boolean
isTemporal()
Returnstrue
if this is aCqnTemporalLiteral
.T
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 Detail
-
value
T value()
Returns the literal value.- Returns:
- the literal value
-
isConstant
default boolean isConstant()
Defines if theCqnLiteral
can be handled as a constant value during query execution.- Returns:
- true if the literal can be handled as a constant value
-
asLiteral
default CqnLiteral<?> asLiteral()
Description copied from interface:CqnValue
Casts this value toCqnLiteral
.
-
isLiteral
default boolean isLiteral()
Description copied from interface:CqnValue
Returnstrue
if this is aCqnLiteral
.
-
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
-
asBoolean
default CqnBooleanLiteral asBoolean()
Casts this literal toCqnBooleanLiteral
.- Returns:
- this literal as a boolean literal
- Throws:
ClassCastException
- if this literal is not boolean
-
asString
default CqnStringLiteral asString()
Casts this literal toCqnStringLiteral
.- Returns:
- this literal as a string literal
- Throws:
ClassCastException
- if this literal is not a string literal
-
asNumber
default CqnNumericLiteral<?> asNumber()
Casts this literal toCqnNumericLiteral
.- Returns:
- this literal as a numeric literal
- Throws:
ClassCastException
- if this literal is not numeric
-
asTemporal
default CqnTemporalLiteral<?> asTemporal()
Casts this literal toCqnTemporalLiteral
.- Returns:
- this literal as a temporal literal
- Throws:
ClassCastException
- if this literal is not temporal
-
asStructured
default CqnStructuredLiteral asStructured()
Casts this literal toCqnStructuredLiteral
.- Returns:
- this literal as a structured literal
- Throws:
ClassCastException
- if this literal is not structured
-
-