public class SetSerializer<T> extends CollectionSerializer<java.util.Set<T>>
| Modifier and Type | Field and Description |
|---|---|
TypeSerializer<T> |
elements |
| Modifier and Type | Method and Description |
|---|---|
java.util.Set<T> |
deserializeForNativeProtocol(java.nio.ByteBuffer bytes,
ProtocolVersion version) |
int |
getElementCount(java.util.Set<T> value) |
static <T> SetSerializer<T> |
getInstance(TypeSerializer<T> elements,
java.util.Comparator<java.nio.ByteBuffer> elementComparator) |
java.nio.ByteBuffer |
getSerializedValue(java.nio.ByteBuffer collection,
java.nio.ByteBuffer key,
AbstractType<?> comparator)
Extract an element from a serialized collection.
|
java.nio.ByteBuffer |
getSliceFromSerialized(java.nio.ByteBuffer collection,
java.nio.ByteBuffer from,
java.nio.ByteBuffer to,
AbstractType<?> comparator,
boolean frozen)
Returns the slice of a collection directly from its serialized value.
|
java.lang.Class<java.util.Set<T>> |
getType() |
java.util.List<java.nio.ByteBuffer> |
serializeValues(java.util.Set<T> values) |
java.lang.String |
toString(java.util.Set<T> value) |
void |
validateForNativeProtocol(java.nio.ByteBuffer bytes,
ProtocolVersion version) |
copyAsNewCollection, deserialize, pack, readCollectionSize, readValue, serialize, sizeOfCollectionSize, sizeOfValue, skipValue, validate, writeCollectionSize, writeValueclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waittoCQLLiteralpublic final TypeSerializer<T> elements
public static <T> SetSerializer<T> getInstance(TypeSerializer<T> elements, java.util.Comparator<java.nio.ByteBuffer> elementComparator)
public java.util.List<java.nio.ByteBuffer> serializeValues(java.util.Set<T> values)
serializeValues in class CollectionSerializer<java.util.Set<T>>public int getElementCount(java.util.Set<T> value)
getElementCount in class CollectionSerializer<java.util.Set<T>>public void validateForNativeProtocol(java.nio.ByteBuffer bytes,
ProtocolVersion version)
validateForNativeProtocol in class CollectionSerializer<java.util.Set<T>>public java.util.Set<T> deserializeForNativeProtocol(java.nio.ByteBuffer bytes, ProtocolVersion version)
deserializeForNativeProtocol in class CollectionSerializer<java.util.Set<T>>public java.lang.String toString(java.util.Set<T> value)
public java.lang.Class<java.util.Set<T>> getType()
public java.nio.ByteBuffer getSerializedValue(java.nio.ByteBuffer collection,
java.nio.ByteBuffer key,
AbstractType<?> comparator)
CollectionSerializer
Note that this is only supported to sets and maps. For sets, this mostly ends up being
a check for the presence of the provide key: it will return the key if it's present and
null otherwise.
getSerializedValue in class CollectionSerializer<java.util.Set<T>>collection - the serialized collection. This cannot be null.key - the key to extract (This cannot be null nor ByteBufferUtil.UNSET_BYTE_BUFFER).comparator - the type to use to compare the key value to those
in the collection.key if one exists, null otherwisepublic java.nio.ByteBuffer getSliceFromSerialized(java.nio.ByteBuffer collection,
java.nio.ByteBuffer from,
java.nio.ByteBuffer to,
AbstractType<?> comparator,
boolean frozen)
CollectionSerializerIf the slice contains no elements an empty collection will be returned for frozen collections, and a
null one for non-frozen collections.
getSliceFromSerialized in class CollectionSerializer<java.util.Set<T>>collection - the serialized collection. This cannot be null.from - the left bound of the slice to extract. This cannot be null but if this is
ByteBufferUtil.UNSET_BYTE_BUFFER, then the returned slice starts at the beginning
of collection.comparator - the type to use to compare the from and to values to those
in the collection.frozen - true if the collection is a frozen one, false otherwise[from, to] of collection.Copyright © 2009-2019 The Apache Software Foundation