Package org.apache.cassandra.cql3
Class Term.Terminal
java.lang.Object
org.apache.cassandra.cql3.Term.Terminal
- All Implemented Interfaces:
Term
- Direct Known Subclasses:
Constants.Value,Maps.Value,Sets.Value,Term.MultiItemTerminal,Tuples.InValue
- Enclosing interface:
- Term
A terminal term, one that can be reduced to a byte buffer directly.
This includes most terms that don't have a bind marker (an exception
being delayed call for non pure function that are NonTerminal even
if they don't have bind markers).
This can be only one of:
- a constant value
- a collection value
Note that a terminal term will always have been type checked, and thus
consumer can (and should) assume so.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.apache.cassandra.cql3.Term
Term.MultiColumnRaw, Term.MultiItemTerminal, Term.NonTerminal, Term.Raw, Term.Terminal -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFunctionsTo(List<Function> functions) bind(QueryOptions options) Bind the values in this term to the values contained invalues.bindAndGet(QueryOptions options) A shorter for bind(values).get().voidcollectMarkerSpecification(VariableSpecifications boundNames) Collects the column specification for the bind variables in this Term.booleanWhether or not that term contains at least one bind marker.abstract ByteBufferget(ProtocolVersion version) booleanWhether that term is terminal (this is a shortcut forthis instanceof Term.Terminal).
-
Constructor Details
-
Terminal
public Terminal()
-
-
Method Details
-
collectMarkerSpecification
Description copied from interface:TermCollects the column specification for the bind variables in this Term. This is obviously a no-op if the term is Terminal.- Specified by:
collectMarkerSpecificationin interfaceTerm- Parameters:
boundNames- the variables specification where to collect the bind variables of this term in.
-
bind
Description copied from interface:TermBind the values in this term to the values contained invalues. This is obviously a no-op if the term is Terminal. -
addFunctionsTo
- Specified by:
addFunctionsToin interfaceTerm
-
containsBindMarker
public boolean containsBindMarker()Description copied from interface:TermWhether or not that term contains at least one bind marker. Note that this is slightly different from being or not a NonTerminal, because calls to non pure functions will be NonTerminal (see #5616) even if they don't have bind markers.- Specified by:
containsBindMarkerin interfaceTerm
-
isTerminal
public boolean isTerminal()Description copied from interface:TermWhether that term is terminal (this is a shortcut forthis instanceof Term.Terminal).- Specified by:
isTerminalin interfaceTerm
-
get
- Returns:
- the serialized value of this terminal.
- Throws:
InvalidRequestException
-
bindAndGet
Description copied from interface:TermA shorter for bind(values).get(). We expose it mainly because for constants it can avoids allocating a temporary object between the bind and the get (note that we still want to be able to separate bind and get for collections).- Specified by:
bindAndGetin interfaceTerm- Throws:
InvalidRequestException
-