CType (apache-cassandra API)
Date: 2018-02-12

org.apache.cassandra.db.composites

## Interface CType

- All Superinterfaces:
    java.util.Comparator<Composite>
  All Known Subinterfaces:
    CellNameType
  All Known Implementing Classes:
    AbstractCellNameType, AbstractCompoundCellNameType, AbstractCType, AbstractSimpleCellNameType, CompoundCType, CompoundDenseCellNameType, CompoundSparseCellNameType, CompoundSparseCellNameType.WithCollection, SimpleCType, SimpleDenseCellNameType, SimpleSparseCellNameType

      public interface CType
      extends java.util.Comparator<Composite>

  A type for a Composite. There is essentially 2 types of Composite and such of CType: 1. the "simple" ones, see SimpleCType. 2. the "truly-composite" ones, see CompositeCType. API-wise, a CType is simply a collection of AbstractType with a few utility methods.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Interface and Description
    --- | ---
    `static interface` | `CType.Serializer`

  - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method and Description
    --- | ---
    `AbstractType<?>` | `asAbstractType()` Returns a AbstractType corresponding to this CType for thrift sake.
    `CBuilder` | `builder()` A builder of Composite.
    `int` | `compare(Composite o1, Composite o2)`
    `DeletionInfo.Serializer` | `deletionInfoSerializer()`
    `Composite` | `fromByteBuffer(java.nio.ByteBuffer bb)` Deserialize a Composite from a ByteBuffer.
    `java.lang.String` | `getString(Composite c)` Converts a composite to a user-readable string.
    `java.util.Comparator<IndexHelper.IndexInfo>` | `indexComparator()`
    `java.util.Comparator<IndexHelper.IndexInfo>` | `indexReverseComparator()`
    `boolean` | `isCompatibleWith(CType previous)` See AbstractType#isCompatibleWith.
    `boolean` | `isCompound()` Returns whether this is a "truly-composite" underneath.
    `Composite` | `make(java.lang.Object... components)` Convenience method to build composites from their component.
    `RangeTombstone.Serializer` | `rangeTombstoneSerializer()`
    `java.util.Comparator<Composite>` | `reverseComparator()`
    `CType.Serializer` | `serializer()`
    `CType` | `setSubtype(int position, AbstractType<?> newType)` Returns a new CType that is equivalent to this CType but with one of the subtype replaced by the provided new type.
    `int` | `size()` The number of subtypes for this CType.
    `IVersionedSerializer<SliceQueryFilter>` | `sliceQueryFilterSerializer()`
    `IVersionedSerializer<ColumnSlice>` | `sliceSerializer()`
    `AbstractType<?>` | `subtype(int i)` Gets a subtype of this CType.
    `void` | `validate(Composite name)` Validates a composite.

    - ### Methods inherited from interface java.util.Comparator

      `comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong`

- - ### Method Detail

    - #### isCompound

          boolean isCompound()

      Returns whether this is a "truly-composite" underneath.

    - #### size

          int size()

      The number of subtypes for this CType.

    - #### compare

          int compare(Composite o1,
                      Composite o2)

      Specified by:
        `compare` in interface `java.util.Comparator<Composite>`

    - #### subtype

          AbstractType<?> subtype(int i)

      Gets a subtype of this CType.

    - #### builder

          CBuilder builder()

      A builder of Composite.

    - #### make

          Composite make(java.lang.Object... components)

      Convenience method to build composites from their component. The arguments can be either ByteBuffer or actual objects of the type corresponding to their position.

    - #### validate

          void validate(Composite name)

      Validates a composite.

    - #### getString

          java.lang.String getString(Composite c)

      Converts a composite to a user-readable string.

    - #### isCompatibleWith

          boolean isCompatibleWith(CType previous)

      See AbstractType#isCompatibleWith.

    - #### setSubtype

          CType setSubtype(int position,
                           AbstractType<?> newType)

      Returns a new CType that is equivalent to this CType but with one of the subtype replaced by the provided new type.

    - #### fromByteBuffer

          Composite fromByteBuffer(java.nio.ByteBuffer bb)

      Deserialize a Composite from a ByteBuffer. This is meant for thrift to convert the fully serialized buffer we get from the clients to composites.

    - #### asAbstractType

          AbstractType<?> asAbstractType()

      Returns a AbstractType corresponding to this CType for thrift sake. If the CType is a "simple" one, this just return the wrapped type, otherwise it returns the corresponding org.apache.cassandra.db.marshal.CompositeType. This is only meant to be use for backward compatibility (particularly for thrift) but it's not meant to be used internally.

    - #### reverseComparator

          java.util.Comparator<Composite> reverseComparator()

    - #### indexComparator

          java.util.Comparator<IndexHelper.IndexInfo> indexComparator()

    - #### indexReverseComparator

          java.util.Comparator<IndexHelper.IndexInfo> indexReverseComparator()

    - #### serializer

          CType.Serializer serializer()

    - #### sliceSerializer

          IVersionedSerializer<ColumnSlice> sliceSerializer()

    - #### sliceQueryFilterSerializer

          IVersionedSerializer<SliceQueryFilter> sliceQueryFilterSerializer()

    - #### deletionInfoSerializer

          DeletionInfo.Serializer deletionInfoSerializer()

    - #### rangeTombstoneSerializer

          RangeTombstone.Serializer rangeTombstoneSerializer()

Copyright © 2018 The Apache Software Foundation