org.apache.cassandra.db.composites

## Class SimpleCType

- java.lang.Object
- - org.apache.cassandra.db.composites.AbstractCType
  - - org.apache.cassandra.db.composites.SimpleCType

All Implemented Interfaces:
  java.util.Comparator<Composite>, CType

    public class SimpleCType
    extends AbstractCType

A not truly-composite CType.

### Nested Class Summary

Nested Classes
`static class` `SimpleCType.SimpleCBuilder`

### Field Summary

Fields
`protected AbstractType<?>` `type`

### Fields inherited from class org.apache.cassandra.db.composites.AbstractCType

`isByteOrderComparable`

### Constructor Summary

Constructors
Constructor and Description
`SimpleCType(AbstractType<?> type)`

### Method Summary

All Methods Instance Methods Concrete Methods
`AbstractType<?>` `asAbstractType()` Returns a AbstractType corresponding to this CType for thrift sake.
`CBuilder` `builder()` A builder of Composite.
`int` `compare(Composite c1, Composite c2)`
`Composite` `fromByteBuffer(java.nio.ByteBuffer bytes)` Deserialize a Composite from a ByteBuffer.
`boolean` `isCompound()` Returns whether this is a "truly-composite" underneath.
`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.
`AbstractType<?>` `subtype(int i)` Gets a subtype of this CType.

### Methods inherited from class org.apache.cassandra.db.composites.AbstractCType

`checkRemaining, deletionInfoSerializer, equals, getByteOrderAsymmetricColumnComparator, getByteOrderColumnComparator, getString, hashCode, indexComparator, indexReverseComparator, isByteOrderComparable, isCompatibleWith, make, rangeTombstoneSerializer, reverseComparator, serializer, sliceBytes, sliceQueryFilterSerializer, sliceSerializer, toString, validate`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

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

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

### Field Detail

#### type

    protected final AbstractType<?> type

### Constructor Detail

#### SimpleCType

    public SimpleCType(AbstractType<?> type)

### Method Detail

#### isCompound

    public boolean isCompound()

Description copied from interface: `CType`
Returns whether this is a "truly-composite" underneath.

#### size

    public int size()

Description copied from interface: `CType`
The number of subtypes for this CType.

#### compare

    public int compare(Composite c1,
                       Composite c2)

Specified by:
  `compare` in interface `java.util.Comparator<Composite>`
Specified by:
  `compare` in interface `CType`
Overrides:
  `compare` in class `AbstractCType`

#### subtype

    public AbstractType<?> subtype(int i)

Description copied from interface: `CType`
Gets a subtype of this CType.

#### fromByteBuffer

    public Composite fromByteBuffer(java.nio.ByteBuffer bytes)

Description copied from interface: `CType`
Deserialize a Composite from a ByteBuffer. This is meant for thrift to convert the fully serialized buffer we get from the clients to composites.

#### builder

    public CBuilder builder()

Description copied from interface: `CType`
A builder of Composite.

#### setSubtype

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

Description copied from interface: `CType`
Returns a new CType that is equivalent to this CType but with one of the subtype replaced by the provided new type.

#### asAbstractType

    public AbstractType<?> asAbstractType()

Description copied from interface: `CType`
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.