Interface AssignmentTestable

All Known Subinterfaces:
AggregateFunction, Function, PartialScalarFunction, ScalarFunction, Selectable
All Known Implementing Classes:
AbstractCompositeType, AbstractFunction, AbstractMarker.INRaw, AbstractMarker.MultiColumnRaw, AbstractMarker.Raw, AbstractTimeUUIDType, AbstractType, AggregateFcts.CountRowsFunction, ArrayLiteral, AsciiType, BooleanType, BytesConversionFcts.FromBlobFunction, BytesConversionFcts.ToBlobFunction, BytesType, ByteType, CollectionType, ColumnMetadata, CompositeType, Constants.Literal, CounterColumnType, DateType, DecimalType, DefaultMaskingFunction, DoubleType, DurationType, DynamicCompositeType, DynamicCompositeType.FixedValueComparator, EmptyType, FloatType, FromJsonFct, FrozenType, FunctionCall.Raw, HashMaskingFunction, InetAddressType, Int32Type, IntegerType, JavaBasedUDFunction, LegacyTimeUUIDType, LexicalUUIDType, Lists.Literal, ListType, LongType, Maps.Literal, MapType, MaskingFunction, NativeAggregateFunction, NativeFunction, NativeScalarFunction, NullMaskingFunction, NumberType, PartialMaskingFunction, PartitionerDefinedOrder, ReplaceMaskingFunction, ReversedType, Selectable.BetweenParenthesesOrWithTuple, Selectable.WithArrayLiteral, Selectable.WithCast, Selectable.WithElementSelection, Selectable.WithFieldSelection, Selectable.WithFunction, Selectable.WithList, Selectable.WithMapOrUdt, Selectable.WithSet, Selectable.WithSliceSelection, Selectable.WithTerm, Selectable.WithTypeHint, Selectable.WithVector, Selectable.WritetimeOrTTL, Sets.Literal, SetType, ShortType, SimpleDateType, StringType, TemporalType, Term.MultiColumnRaw, Term.Raw, TimeFcts.FloorDateFunction, TimeFcts.FloorTimestampFunction, TimeFcts.FloorTimeUuidFunction, TimeFcts.TemporalConversionFunction, TimestampType, TimeType, TimeUUIDType, ToJsonFct, TokenFct, Tuples.INRaw, Tuples.Literal, Tuples.Raw, TupleType, TypeCast, UDAggregate, UDFunction, UserFunction, UserType, UserTypes.Literal, UTF8Type, UUIDType, Vectors.Literal, VectorType

public interface AssignmentTestable
  • Method Details

    • testAssignment

      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.
    • getCompatibleTypeIfKnown

      @Nullable AbstractType<?> getCompatibleTypeIfKnown(String keyspace)
      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.
    • getCompatibleTypeIfKnown

      @Nullable static AbstractType<?> getCompatibleTypeIfKnown(Collection<AbstractType<?>> types)
      Returns:
      A data type that can represent all the specified types, or null if there isn't one.