Interface CqnLiteral<T>

All Superinterfaces:
CqnToken, CqnValue, JSONizable
All Known Subinterfaces:
BooleanValue, CqnBooleanLiteral, CqnNumericLiteral<N>, CqnStringLiteral, CqnStructuredLiteral, CqnTemporalLiteral<E>, Literal<T>

public interface CqnLiteral<T> extends CqnValue
A CQN literal value of type CqnLiteral. Use value() to get the value.
  • Method Details

    • value

      T value()
      Returns the literal value.
      Returns:
      the literal value
    • isConstant

      default boolean isConstant()
      Specifies if this CqnLiteral should 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 to CqnLiteral.
      Specified by:
      asLiteral in interface CqnValue
      Returns:
      this value as a literal
    • isLiteral

      default boolean isLiteral()
      Description copied from interface: CqnValue
      Returns true if this is a CqnLiteral.
      Specified by:
      isLiteral in interface CqnValue
      Returns:
      true if this is a literal, otherwise false
    • isBoolean

      default boolean isBoolean()
      Returns true if this is a CqnBooleanLiteral.
      Returns:
      true if this is a boolean literal, otherwise false
    • isNumeric

      default boolean isNumeric()
      Returns true if this is a CqnNumericLiteral.
      Returns:
      true if this is a numeric literal, otherwise false
    • isString

      default boolean isString()
      Returns true if this is a CqnStringLiteral.
      Returns:
      true if this is a string literal, otherwise false
    • isTemporal

      default boolean isTemporal()
      Returns true if this is a CqnTemporalLiteral.
      Returns:
      true if this is a temporal literal, otherwise false
    • isStructured

      default boolean isStructured()
      Returns true if this is a CqnStructuredLiteral.
      Returns:
      true if this is a structured literal, otherwise false
    • asBoolean

      default CqnBooleanLiteral asBoolean()
      Casts this literal to CqnBooleanLiteral.
      Returns:
      this literal as a boolean literal
      Throws:
      ClassCastException - if this literal is not boolean
    • asString

      default CqnStringLiteral asString()
      Casts this literal to CqnStringLiteral.
      Returns:
      this literal as a string literal
      Throws:
      ClassCastException - if this literal is not a string literal
    • asNumber

      default CqnNumericLiteral<?> asNumber()
      Casts this literal to CqnNumericLiteral.
      Returns:
      this literal as a numeric literal
      Throws:
      ClassCastException - if this literal is not numeric
    • asTemporal

      default CqnTemporalLiteral<?> asTemporal()
      Casts this literal to CqnTemporalLiteral.
      Returns:
      this literal as a temporal literal
      Throws:
      ClassCastException - if this literal is not temporal
    • asStructured

      default CqnStructuredLiteral asStructured()
      Casts this literal to CqnStructuredLiteral.
      Returns:
      this literal as a structured literal
      Throws:
      ClassCastException - if this literal is not structured