Class CompositeType

    • Field Detail

    • Constructor Detail

      • CompositeType

        protected CompositeType​(java.util.List<AbstractType<?>> types)
    • Method Detail

      • startingOffsetInternal

        protected static int startingOffsetInternal​(boolean isStatic)
      • readIsStaticInternal

        protected static <V> boolean readIsStaticInternal​(V value,
                                                          ValueAccessor<V> accessor)
      • getComparator

        protected <V> AbstractType<?> getComparator​(int i,
                                                    V value,
                                                    ValueAccessor<V> accessor,
                                                    int offset)
        Specified by:
        getComparator in class AbstractCompositeType
        Parameters:
        i - DynamicCompositeType will read the type information from @param bb
        value - name of type definition
        Returns:
        the comparator for the given component. static CompositeType will consult
      • splitName

        public static <V> java.util.List<V> splitName​(V name,
                                                      ValueAccessor<V> accessor)
      • extractComponent

        public static java.nio.ByteBuffer extractComponent​(java.nio.ByteBuffer bb,
                                                           int idx)
      • isStaticName

        public static <V> boolean isStaticName​(V value,
                                               ValueAccessor<V> accessor)
      • getComponents

        public java.util.List<AbstractType<?>> getComponents()
        Description copied from class: AbstractType
        Return a list of the "subcomponents" this type has. This always return a singleton list with the type itself except for CompositeType.
        Overrides:
        getComponents in class AbstractType<java.nio.ByteBuffer>
      • isCompatibleWith

        public boolean isCompatibleWith​(AbstractType<?> previous)
        Description copied from class: AbstractType
        Returns true if this comparator is compatible with the provided previous comparator, that is if previous can safely be replaced by this. A comparator cn should be compatible with a previous one cp if forall columns c1 and c2, if cn.validate(c1) and cn.validate(c2) and cn.compare(c1, c2) == v, then cp.validate(c1) and cp.validate(c2) and cp.compare(c1, c2) == v. Note that a type should be compatible with at least itself and when in doubt, keep the default behavior of not being compatible with any other comparator!
        Overrides:
        isCompatibleWith in class AbstractType<java.nio.ByteBuffer>
      • isValueCompatibleWithInternal

        public boolean isValueCompatibleWithInternal​(AbstractType<?> otherType)
        Description copied from class: AbstractType
        Needed to handle ReversedType in value-compatibility checks. Subclasses should implement this instead of isValueCompatibleWith().
        Overrides:
        isValueCompatibleWithInternal in class AbstractType<java.nio.ByteBuffer>
      • withUpdatedUserType

        public CompositeType withUpdatedUserType​(UserType udt)
        Description copied from class: AbstractType
        Returns an instance of this type with all references to the provided user type recursively replaced with its new definition.
        Overrides:
        withUpdatedUserType in class AbstractType<java.nio.ByteBuffer>
      • expandUserTypes

        public AbstractType<?> expandUserTypes()
        Description copied from class: AbstractType
        Replace any instances of UserType with equivalent TupleType-s. We need it for dropped_columns, to allow safely dropping unused user types later without retaining any references to them in system_schema.dropped_columns.
        Overrides:
        expandUserTypes in class AbstractType<java.nio.ByteBuffer>
      • toString

        public java.lang.String toString()
        Description copied from class: AbstractType
        This must be overriden by subclasses if necessary so that for any AbstractType, this == TypeParser.parse(toString()). Note that for backwards compatibility this includes the full classname. For CQL purposes the short name is fine.
        Overrides:
        toString in class AbstractType<java.nio.ByteBuffer>
      • build

        @SafeVarargs
        public static <V> V build​(ValueAccessor<V> accessor,
                                  V... values)
      • build

        @SafeVarargs
        public static <V> V build​(ValueAccessor<V> accessor,
                                  boolean isStatic,
                                  V... values)