Interface CqnValue

    • Method Detail

      • type

        default Optional<String> type()
        Returns the optional CDS type of this value.
        Returns:
        the optional CDS type
      • isRef

        default boolean isRef()
        Returns true if this is a CqnElementRef.
        Returns:
        true if this is an element ref, otherwise false
      • isExpression

        default boolean isExpression()
        Returns true if this is a CqnExpression.
        Returns:
        true if this is an expression, otherwise false
      • isFunction

        default boolean isFunction()
        Returns true if this is a CqnFunc.
        Returns:
        true if this is a function, otherwise false
      • isLiteral

        default boolean isLiteral()
        Returns true if this is a CqnLiteral.
        Returns:
        true if this is a literal, otherwise false
      • isNullValue

        default boolean isNullValue()
        Returns true if this is a CqnNullValue.
        Returns:
        true if this is a null value, otherwise false
      • isParameter

        default boolean isParameter()
        Returns true if this is a CqnParameter.
        Returns:
        true if this is a parameter, otherwise false
      • isPlain

        default boolean isPlain()
        Returns true if this is a CqnPlain value.
        Returns:
        true if this is a plain value, otherwise false
      • isList

        default boolean isList()
        Returns true if this is a CqnListValue value.
        Returns:
        true if this is a list value, otherwise false
      • asRef

        default CqnElementRef asRef()
        Casts this value to CqnElementRef.
        Returns:
        this value as an element ref
        Throws:
        ClassCastException - if this value is not an element ref
      • asExpression

        default CqnExpression asExpression()
        Casts this value to CqnExpression.
        Returns:
        this value as an expression
        Throws:
        ClassCastException - if this value is not an expression
      • asFunction

        default CqnFunc asFunction()
        Casts this value to CqnFunc.
        Returns:
        this value as a function
        Throws:
        ClassCastException - if this value is not a function
      • asLiteral

        default CqnLiteral<?> asLiteral()
        Casts this value to CqnLiteral.
        Returns:
        this value as a literal
        Throws:
        ClassCastException - if this value is not a literal
      • asNullValue

        default CqnNullValue asNullValue()
        Casts this value to CqnNullValue.
        Returns:
        this value as a null value
        Throws:
        ClassCastException - if this value is not a null value
      • asParameter

        default CqnParameter asParameter()
        Casts this value to CqnParameter.
        Returns:
        this value as a parameter
        Throws:
        ClassCastException - if this value is not a parameter
      • asPlain

        default CqnPlain asPlain()
        Casts this value to CqnPlain.
        Returns:
        this value as a plain value
        Throws:
        ClassCastException - if this value is not a plain value
      • asList

        default CqnListValue asList()
        Casts this value to CqnListValue.
        Returns:
        this value as a list value
        Throws:
        ClassCastException - if this value is not a list value
      • as

        default <T extends CqnValue> T as​(Class<T> type)
        Casts this type to the given type.
        Type Parameters:
        T - the return type
        Parameters:
        type - the subtype of CqnValue to cast to
        Returns:
        this type casted to the given type class