public abstract class CollectionType<T> extends AbstractType<T>
Modifier and Type | Class and Description |
---|---|
static class |
CollectionType.Kind |
Modifier and Type | Field and Description |
---|---|
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() |
java.util.List<Cell> |
enforceLimit(ColumnDefinition def,
java.util.List<Cell> cells,
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.
|
abstract AbstractType<?> |
nameComparator() |
abstract java.util.List<java.nio.ByteBuffer> |
serializedValues(java.util.List<Cell> cells) |
java.nio.ByteBuffer |
serializeForNativeProtocol(ColumnDefinition def,
java.util.List<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() |
compareCollectionMembers, componentsCount, compose, decompose, freeze, fromStringCQL2, getComponents, getString, isByteOrderComparable, isCounter, isMultiCell, isValueCompatibleWith, parseDefaultParameters, references, toString, validate, validateCollectionMember
public static final int MAX_ELEMENTS
public final CollectionType.Kind kind
protected CollectionType(CollectionType.Kind kind)
public abstract AbstractType<?> nameComparator()
public abstract AbstractType<?> valueComparator()
public abstract CollectionSerializer<T> getSerializer()
getSerializer
in class AbstractType<T>
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.public java.util.List<Cell> enforceLimit(ColumnDefinition def, java.util.List<Cell> cells, int version)
public abstract java.util.List<java.nio.ByteBuffer> serializedValues(java.util.List<Cell> cells)
public java.nio.ByteBuffer serializeForNativeProtocol(ColumnDefinition def, java.util.List<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 © 2016 The Apache Software Foundation