Interface Selectable
-
- All Superinterfaces:
AssignmentTestable
- All Known Implementing Classes:
ColumnMetadata,Selectable.BetweenParenthesesOrWithTuple,Selectable.WithCast,Selectable.WithElementSelection,Selectable.WithFieldSelection,Selectable.WithFunction,Selectable.WithList,Selectable.WithMapOrUdt,Selectable.WithSet,Selectable.WithSliceSelection,Selectable.WithTerm,Selectable.WithToJSonFunction,Selectable.WithTypeHint,Selectable.WritetimeOrTTL
public interface Selectable extends AssignmentTestable
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classSelectable.BetweenParenthesesOrWithTupleSelectableforSelectablebetween parentheses or tuples.static interfaceSelectable.Rawstatic classSelectable.RawIdentifierIn the selection clause, the parser cannot differentiate between Maps and UDTs as a column identifier and field identifier have the same syntax.static classSelectable.WithCaststatic classSelectable.WithElementSelectionRepresents the selection of an element of a collection (eg.static classSelectable.WithFieldSelectionRepresents the selection of the field of a UDT (eg.static classSelectable.WithFunctionstatic classSelectable.WithListSelectablefor literal Lists.static classSelectable.WithMapOrUdtSelectablefor literal Maps or UDTs.static classSelectable.WithSetSelectablefor literal Sets.static classSelectable.WithSliceSelectionRepresents the selection of a slice of a collection (eg.static classSelectable.WithTermstatic classSelectable.WithToJSonFunctionstatic classSelectable.WithTypeHintSelectablefor type hints (e.g.static classSelectable.WritetimeOrTTL-
Nested classes/interfaces inherited from interface org.apache.cassandra.cql3.AssignmentTestable
AssignmentTestable.TestResult
-
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default intaddAndGetIndex(ColumnMetadata def, java.util.List<ColumnMetadata> l)AbstractType<?>getExactTypeIfKnown(java.lang.String keyspace)The type of theSelectableif it can be infered.Selector.FactorynewSelectorFactory(TableMetadata table, AbstractType<?> expectedType, java.util.List<ColumnMetadata> defs, VariableSpecifications boundNames)default booleanprocessesSelection()Checks if any processing is performed on the selected columns,falseotherwise.booleanselectColumns(java.util.function.Predicate<ColumnMetadata> predicate)Checks if thisSelectableselect columns matching the specified predicate.static booleanselectColumns(java.util.List<Selectable> selectables, java.util.function.Predicate<ColumnMetadata> predicate)Checks if the specified Selectables select columns matching the specified predicate.default ColumnSpecificationspecForElementOrSlice(Selectable selected, ColumnSpecification receiver, CollectionType.Kind kind, java.lang.String selectionType)default AssignmentTestable.TestResulttestAssignment(java.lang.String keyspace, ColumnSpecification receiver)
-
-
-
Method Detail
-
newSelectorFactory
Selector.Factory newSelectorFactory(TableMetadata table, AbstractType<?> expectedType, java.util.List<ColumnMetadata> defs, VariableSpecifications boundNames)
-
getExactTypeIfKnown
AbstractType<?> getExactTypeIfKnown(java.lang.String keyspace)
The type of theSelectableif it can be infered.- Parameters:
keyspace- the keyspace on which the statement for which this is aSelectableis on.- Returns:
- the type of this
Selectableif inferrable, ornullotherwise (for instance, the type isn't inferable 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 returnnulltoo).
-
selectColumns
boolean selectColumns(java.util.function.Predicate<ColumnMetadata> predicate)
Checks if thisSelectableselect columns matching the specified predicate.- Returns:
trueif thisSelectableselect columns matching the specified predicate,falseotherwise.
-
selectColumns
static boolean selectColumns(java.util.List<Selectable> selectables, java.util.function.Predicate<ColumnMetadata> predicate)
Checks if the specified Selectables select columns matching the specified predicate.- Parameters:
selectables- the selectables to check.- Returns:
trueif the specified Selectables select columns matching the specified predicate,falseotherwise.
-
processesSelection
default boolean processesSelection()
Checks if any processing is performed on the selected columns,falseotherwise.- Returns:
trueif any processing is performed on the selected columns,falseotherwise.
-
testAssignment
default AssignmentTestable.TestResult testAssignment(java.lang.String keyspace, ColumnSpecification receiver)
- Specified by:
testAssignmentin interfaceAssignmentTestable- 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.
-
addAndGetIndex
default int addAndGetIndex(ColumnMetadata def, java.util.List<ColumnMetadata> l)
-
specForElementOrSlice
default ColumnSpecification specForElementOrSlice(Selectable selected, ColumnSpecification receiver, CollectionType.Kind kind, java.lang.String selectionType)
-
-