Package org.apache.cassandra.cql3
Class Term.Raw
- java.lang.Object
-
- org.apache.cassandra.cql3.Term.Raw
-
- All Implemented Interfaces:
AssignmentTestable
- Direct Known Subclasses:
AbstractMarker.Raw
,ArrayLiteral
,Constants.Literal
,FunctionCall.Raw
,Lists.Literal
,Maps.Literal
,Sets.Literal
,Term.MultiColumnRaw
,TypeCast
,UserTypes.Literal
,Vectors.Literal
- Enclosing interface:
- Term
public abstract static class Term.Raw extends java.lang.Object implements AssignmentTestable
A parsed, non prepared (thus untyped) term. This can be one of: - a constant - a collection literal - a function call - a marker
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.apache.cassandra.cql3.AssignmentTestable
AssignmentTestable.TestResult
-
-
Constructor Summary
Constructors Constructor Description Raw()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description boolean
equals(java.lang.Object o)
AbstractType<?>
getCompatibleTypeIfKnown(java.lang.String keyspace)
abstract AbstractType<?>
getExactTypeIfKnown(java.lang.String keyspace)
The type of theterm
if it can be infered.abstract java.lang.String
getText()
int
hashCode()
abstract Term
prepare(java.lang.String keyspace, ColumnSpecification receiver)
This method validates this RawTerm is valid for provided column specification and "prepare" this RawTerm, returning the resulting prepared Term.java.lang.String
toString()
-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.apache.cassandra.cql3.AssignmentTestable
testAssignment
-
-
-
-
Method Detail
-
prepare
public abstract Term prepare(java.lang.String keyspace, ColumnSpecification receiver) throws InvalidRequestException
This method validates this RawTerm is valid for provided column specification and "prepare" this RawTerm, returning the resulting prepared Term.- Parameters:
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
-
getText
public abstract java.lang.String getText()
- Returns:
- a String representation of the raw term that can be used when reconstructing a CQL query string.
-
getExactTypeIfKnown
public abstract AbstractType<?> getExactTypeIfKnown(java.lang.String keyspace)
The type of theterm
if it can be infered.- Parameters:
keyspace
- the keyspace on which the statement containing this term is on.- Returns:
- the type of this
Term
if inferrable, ornull
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 returnnull
too).
-
getCompatibleTypeIfKnown
public AbstractType<?> getCompatibleTypeIfKnown(java.lang.String keyspace)
- Specified by:
getCompatibleTypeIfKnown
in interfaceAssignmentTestable
- Returns:
- A data type that can represent this, or
null
if we can't determine that type. The returned type won't necessarely be the exact type, but one that is compatible with it.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCode
in classjava.lang.Object
-
equals
public boolean equals(java.lang.Object o)
- Overrides:
equals
in classjava.lang.Object
-
-