Class SetSerializer<T>

    • Method Detail

      • serializeValues

        public java.util.List<java.nio.ByteBuffer> serializeValues​(java.util.Set<T> values)
        Specified by:
        serializeValues in class CollectionSerializer<java.util.Set<T>>
      • toString

        public java.lang.String toString​(java.util.Set<T> value)
        Specified by:
        toString in class TypeSerializer<java.util.Set<T>>
      • getType

        public java.lang.Class<java.util.Set<T>> getType()
        Specified by:
        getType in class TypeSerializer<java.util.Set<T>>
      • getSerializedValue

        public java.nio.ByteBuffer getSerializedValue​(java.nio.ByteBuffer input,
                                                      java.nio.ByteBuffer key,
                                                      AbstractType<?> comparator)
        Description copied from class: CollectionSerializer
        Extract an element from a serialized collection.

        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.

        Specified by:
        getSerializedValue in class CollectionSerializer<java.util.Set<T>>
        Parameters:
        input - 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.
        Returns:
        the value associated with key if one exists, null otherwise
      • getSliceFromSerialized

        public java.nio.ByteBuffer getSliceFromSerialized​(java.nio.ByteBuffer collection,
                                                          java.nio.ByteBuffer from,
                                                          java.nio.ByteBuffer to,
                                                          AbstractType<?> comparator,
                                                          boolean frozen)
        Description copied from class: CollectionSerializer
        Returns the slice of a collection directly from its serialized value.

        If the slice contains no elements an empty collection will be returned for frozen collections, and a null one for non-frozen collections.

        Specified by:
        getSliceFromSerialized in class CollectionSerializer<T>
        Parameters:
        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
        Returns:
        a serialized collection corresponding to slice [from, to] of collection.
      • getIndexFromSerialized

        public int getIndexFromSerialized​(java.nio.ByteBuffer collection,
                                          java.nio.ByteBuffer key,
                                          AbstractType<?> comparator)
        Description copied from class: CollectionSerializer
        Returns the index of an element in a serialized collection.

        Note that this is only supported by sets and maps, but not by lists.

        Specified by:
        getIndexFromSerialized in class CollectionSerializer<T>
        Parameters:
        collection - The serialized collection. This cannot be null.
        key - The key for which the index must be found. This cannot be null nor ByteBufferUtil.UNSET_BYTE_BUFFER).
        comparator - The type to use to compare the key value to those in the collection.
        Returns:
        The index of the element associated with key if one exists, -1 otherwise.
      • getIndexesRangeFromSerialized

        public com.google.common.collect.Range<java.lang.Integer> getIndexesRangeFromSerialized​(java.nio.ByteBuffer collection,
                                                                                                java.nio.ByteBuffer from,
                                                                                                java.nio.ByteBuffer to,
                                                                                                AbstractType<?> comparator)
        Description copied from class: CollectionSerializer
        Returns the range of indexes corresponding to the specified range of elements in the serialized collection.

        Note that this is only supported by sets and maps, but not by lists.

        Specified by:
        getIndexesRangeFromSerialized in class CollectionSerializer<T>
        Parameters:
        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 the collection.
        to - The left bound of the slice to extract. This cannot be null but if this is ByteBufferUtil.UNSET_BYTE_BUFFER, then the returned slice ends at the end of the collection.
        comparator - The type to use to compare the from and to values to those in the collection.
        Returns:
        The range of indexes corresponding to specified range of elements.