public abstract class CollectionType<T> extends AbstractType<T>
Modifier and Type | Class and Description |
---|---|
static class |
CollectionType.Kind |
Modifier and Type | Field and Description |
---|---|
static CellPath.Serializer |
cellPathSerializer |
CollectionType.Kind |
kind |
static int |
MAX_ELEMENTS |
reverseComparator
Modifier | Constructor and Description |
---|---|
protected |
CollectionType(CollectionType.Kind kind) |
Modifier and Type | Method and Description |
---|---|
CQL3Type |
asCQL3Type() |
protected int |
collectionSize(java.util.List<java.nio.ByteBuffer> values) |
protected int |
enforceLimit(ColumnDefinition def,
java.util.List<java.nio.ByteBuffer> values,
int version) |
java.nio.ByteBuffer |
fromString(java.lang.String source)
get a byte representation of the given string.
|
abstract CollectionSerializer<T> |
getSerializer() |
java.lang.String |
getString(java.nio.ByteBuffer bytes)
get a string representation of the bytes suitable for log messages
|
boolean |
isCollection() |
boolean |
isCompatibleWith(AbstractType<?> previous)
Returns true if this comparator is compatible with the provided
previous comparator, that is if previous can safely be replaced by this.
|
protected abstract boolean |
isCompatibleWithFrozen(CollectionType<?> previous)
A version of isCompatibleWith() to deal with non-multicell (frozen) collections
|
boolean |
isMap()
Checks if this collection is Map.
|
protected abstract boolean |
isValueCompatibleWithFrozen(CollectionType<?> previous)
A version of isValueCompatibleWith() to deal with non-multicell (frozen) collections
|
boolean |
isValueCompatibleWithInternal(AbstractType<?> previous)
Needed to handle ReversedType in value-compatibility checks.
|
ColumnSpecification |
makeCollectionReceiver(ColumnSpecification collection,
boolean isKey) |
abstract AbstractType<?> |
nameComparator() |
protected abstract java.util.List<java.nio.ByteBuffer> |
serializedValues(java.util.Iterator<Cell> cells) |
java.nio.ByteBuffer |
serializeForNativeProtocol(ColumnDefinition def,
java.util.Iterator<Cell> cells,
int version) |
java.lang.String |
toString()
This must be overriden by subclasses if necessary so that for any
AbstractType, this == TypeParser.parse(toString()).
|
void |
validateCellValue(java.nio.ByteBuffer cellValue)
Validate cell value.
|
abstract AbstractType<?> |
valueComparator() |
asCQLTypeStringList, compareCollectionMembers, compareForCQL, componentsCount, compose, decompose, freeze, fromJSONObject, getComponents, getString, isByteOrderComparable, isCounter, isEmptyValueMeaningless, isFrozenCollection, isMultiCell, isValueCompatibleWith, parseDefaultParameters, readValue, skipValue, toJSONString, toString, validate, validateCollectionMember, valueLengthIfFixed, writeValue, writtenLength
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
compare, comparing, comparing, comparingDouble, comparingInt, comparingLong, equals, naturalOrder, nullsFirst, nullsLast, reversed, reverseOrder, thenComparing, thenComparing, thenComparing, thenComparingDouble, thenComparingInt, thenComparingLong
public static final int MAX_ELEMENTS
public static CellPath.Serializer cellPathSerializer
public final CollectionType.Kind kind
protected CollectionType(CollectionType.Kind kind)
public abstract AbstractType<?> nameComparator()
public abstract AbstractType<?> valueComparator()
protected abstract java.util.List<java.nio.ByteBuffer> serializedValues(java.util.Iterator<Cell> cells)
public abstract CollectionSerializer<T> getSerializer()
getSerializer
in class AbstractType<T>
public ColumnSpecification makeCollectionReceiver(ColumnSpecification collection, boolean isKey)
public java.lang.String getString(java.nio.ByteBuffer bytes)
AbstractType
getString
in class AbstractType<T>
public java.nio.ByteBuffer fromString(java.lang.String source)
AbstractType
fromString
in class AbstractType<T>
public boolean isCollection()
isCollection
in class AbstractType<T>
public void validateCellValue(java.nio.ByteBuffer cellValue) throws MarshalException
AbstractType
validateCellValue
in class AbstractType<T>
cellValue
- ByteBuffer representing cell valueMarshalException
public boolean isMap()
true
if this collection is a Map, false
otherwise.protected int collectionSize(java.util.List<java.nio.ByteBuffer> values)
protected int enforceLimit(ColumnDefinition def, java.util.List<java.nio.ByteBuffer> values, int version)
public java.nio.ByteBuffer serializeForNativeProtocol(ColumnDefinition def, java.util.Iterator<Cell> cells, int version)
public boolean isCompatibleWith(AbstractType<?> previous)
AbstractType
isCompatibleWith
in class AbstractType<T>
public boolean isValueCompatibleWithInternal(AbstractType<?> previous)
AbstractType
isValueCompatibleWithInternal
in class AbstractType<T>
protected abstract boolean isCompatibleWithFrozen(CollectionType<?> previous)
protected abstract boolean isValueCompatibleWithFrozen(CollectionType<?> previous)
public CQL3Type asCQL3Type()
asCQL3Type
in class AbstractType<T>
public java.lang.String toString()
AbstractType
toString
in class AbstractType<T>
Copyright © 2015 The Apache Software Foundation