Class Tuples.Literal

All Implemented Interfaces:
AssignmentTestable
Enclosing class:
Tuples

public static class Tuples.Literal extends Term.MultiColumnRaw
A raw, literal tuple. When prepared, this will become a Tuples.Value or Tuples.DelayedValue, depending on whether the tuple holds NonTerminals.
  • Constructor Details

  • Method Details

    • prepare

      public Term prepare(String keyspace, ColumnSpecification receiver) throws InvalidRequestException
      Description copied from class: Term.Raw
      This method validates this RawTerm is valid for provided column specification and "prepare" this RawTerm, returning the resulting prepared Term.
      Specified by:
      prepare in class Term.Raw
      receiver - the "column" this RawTerm is supposed to be a value of. Note that the ColumnSpecification may not correspond to a real column in the case this RawTerm describe a list index or a map key, etc...
      Returns:
      the prepared term.
      Throws:
      InvalidRequestException
    • prepare

      public Term prepare(String keyspace, List<? extends ColumnSpecification> receivers) throws InvalidRequestException
      Specified by:
      prepare in class Term.MultiColumnRaw
      Throws:
      InvalidRequestException
    • testAssignment

      public AssignmentTestable.TestResult testAssignment(String keyspace, ColumnSpecification receiver)
      Returns:
      whether this object can be assigned to the provided receiver. We distinguish between 3 values: - EXACT_MATCH if this object is exactly of the type expected by the receiver - WEAKLY_ASSIGNABLE if this object is not exactly the expected type but is assignable nonetheless - NOT_ASSIGNABLE if it's not assignable Most caller should just call the isAssignable() method on the result, though functions have a use for testing "strong" equality to decide the most precise overload to pick when multiple could match.
    • getExactTypeIfKnown

      public AbstractType<?> getExactTypeIfKnown(String keyspace)
      Description copied from class: Term.Raw
      The type of the term if it can be infered.
      Specified by:
      getExactTypeIfKnown in class Term.Raw
      Parameters:
      keyspace - the keyspace on which the statement containing this term is on.
      Returns:
      the type of this Term if inferrable, or null otherwise (for instance, the type isn't inferrable for a bind marker. Even for literals, the exact type is not inferrable since they are valid for many different types and so this will return null too).
    • getText

      public String getText()
      Specified by:
      getText in class Term.Raw
      Returns:
      a String representation of the raw term that can be used when reconstructing a CQL query string.