public interface Serializer
Modifier and Type | Method and Description |
---|---|
<T> BlockingIterable<T> |
deserialize(BlockingIterable<Buffer> source,
java.lang.Class<T> type)
Applies a deserializer on the passed
BlockingIterable to convert into a Iterable of deserialized
instances of T . |
<T> BlockingIterable<T> |
deserialize(BlockingIterable<Buffer> source,
TypeHolder<T> typeHolder)
Applies a deserializer on the passed
BlockingIterable to convert into a BlockingIterable of
deserialized instances of T . |
<T> CloseableIterable<T> |
deserialize(java.lang.Iterable<Buffer> source,
java.lang.Class<T> type)
Applies a deserializer on the passed
Iterable to convert into a CloseableIterable of deserialized
instances of T . |
<T> CloseableIterable<T> |
deserialize(java.lang.Iterable<Buffer> source,
TypeHolder<T> typeHolder)
Applies a deserializer on the passed
Iterable to convert into a Iterable of deserialized
instances of T . |
<T> Publisher<T> |
deserialize(Publisher<Buffer> source,
java.lang.Class<T> type)
|
<T> Publisher<T> |
deserialize(Publisher<Buffer> source,
TypeHolder<T> typeHolder)
|
<T> CloseableIterable<T> |
deserializeAggregated(Buffer serializedData,
java.lang.Class<T> type)
Deserializes the passed encoded
Buffer to one or more instances of T . |
<T> CloseableIterable<T> |
deserializeAggregated(Buffer serializedData,
TypeHolder<T> typeHolder)
Deserializes the passed encoded
Buffer to zero or more instances of T . |
<T> T |
deserializeAggregatedSingle(Buffer serializedData,
java.lang.Class<T> type)
Deserializes the passed encoded
Buffer to a single instance of T . |
<T> T |
deserializeAggregatedSingle(Buffer serializedData,
TypeHolder<T> typeHolder)
Deserializes the passed encoded
Buffer to a single instance of T . |
<T> BlockingIterable<Buffer> |
serialize(BlockingIterable<T> source,
BufferAllocator allocator,
java.lang.Class<T> type)
Transforms the passed
BlockingIterable such that each contained element of type T is serialized
into a Buffer . |
<T> BlockingIterable<Buffer> |
serialize(BlockingIterable<T> source,
BufferAllocator allocator,
java.lang.Class<T> type,
java.util.function.IntUnaryOperator bytesEstimator)
Transforms the passed
BlockingIterable such that each contained element of type T is serialized
into a Buffer . |
<T> BlockingIterable<Buffer> |
serialize(BlockingIterable<T> source,
BufferAllocator allocator,
TypeHolder<T> typeHolder)
Transforms the passed
BlockingIterable such that each contained element of type T is serialized
into a Buffer . |
<T> BlockingIterable<Buffer> |
serialize(BlockingIterable<T> source,
BufferAllocator allocator,
TypeHolder<T> typeHolder,
java.util.function.IntUnaryOperator bytesEstimator)
Transforms the passed
BlockingIterable such that each contained element of type T is serialized
into a Buffer . |
<T> java.lang.Iterable<Buffer> |
serialize(java.lang.Iterable<T> source,
BufferAllocator allocator,
java.lang.Class<T> type)
Transforms the passed
Iterable such that each contained element of type T is serialized into
a Buffer . |
<T> java.lang.Iterable<Buffer> |
serialize(java.lang.Iterable<T> source,
BufferAllocator allocator,
java.lang.Class<T> type,
java.util.function.IntUnaryOperator bytesEstimator)
Transforms the passed
Iterable such that each contained element of type T is serialized into
a Buffer . |
<T> java.lang.Iterable<Buffer> |
serialize(java.lang.Iterable<T> source,
BufferAllocator allocator,
TypeHolder<T> typeHolder)
Transforms the passed
Iterable such that each contained element of type T is serialized into
a Buffer . |
<T> java.lang.Iterable<Buffer> |
serialize(java.lang.Iterable<T> source,
BufferAllocator allocator,
TypeHolder<T> typeHolder,
java.util.function.IntUnaryOperator bytesEstimator)
Transforms the passed
Iterable such that each contained element of type T is serialized into
a Buffer . |
<T> Publisher<Buffer> |
serialize(Publisher<T> source,
BufferAllocator allocator,
java.lang.Class<T> type)
|
<T> Publisher<Buffer> |
serialize(Publisher<T> source,
BufferAllocator allocator,
java.lang.Class<T> type,
java.util.function.IntUnaryOperator bytesEstimator)
|
<T> Publisher<Buffer> |
serialize(Publisher<T> source,
BufferAllocator allocator,
TypeHolder<T> typeHolder)
|
<T> Publisher<Buffer> |
serialize(Publisher<T> source,
BufferAllocator allocator,
TypeHolder<T> typeHolder,
java.util.function.IntUnaryOperator bytesEstimator)
|
<T> void |
serialize(T toSerialize,
Buffer destination)
Serializes the passed object
toSerialize to the passed Buffer . |
<T> Buffer |
serialize(T toSerialize,
BufferAllocator allocator)
Serializes the passed object
toSerialize to the returned Buffer . |
<T> Buffer |
serialize(T toSerialize,
BufferAllocator allocator,
int bytesEstimate)
Serializes the passed object
toSerialize to the returned Buffer . |
<T> Publisher<Buffer> serialize(Publisher<T> source, BufferAllocator allocator, java.lang.Class<T> type)
Publisher
such that each contained element of type T
is serialized into
a Buffer
.T
- The data type to serialize.source
- Publisher
containing objects to serialize.allocator
- The BufferAllocator
used to allocate Buffer
s.type
- The class for T
, the object to be serialized.Publisher
such that each contained element in the original Publisher
is
transformed from type T
to a Buffer
.<T> java.lang.Iterable<Buffer> serialize(java.lang.Iterable<T> source, BufferAllocator allocator, java.lang.Class<T> type)
Iterable
such that each contained element of type T
is serialized into
a Buffer
.T
- The data type to serialize.source
- Iterable
containing objects to serialize.allocator
- The BufferAllocator
used to allocate Buffer
s.type
- The class for T
, the object to be serialized.Iterable
such that each contained element in the original Iterable
is
transformed from type T
to a Buffer
.<T> BlockingIterable<Buffer> serialize(BlockingIterable<T> source, BufferAllocator allocator, java.lang.Class<T> type)
BlockingIterable
such that each contained element of type T
is serialized
into a Buffer
.T
- The data type to serialize.source
- BlockingIterable
containing objects to serialize.allocator
- The BufferAllocator
used to allocate Buffer
s.type
- The class for T
, the object to be serialized.BlockingIterable
such that each contained element in the original
BlockingIterable
is transformed from type T
to a Buffer
.<T> Publisher<Buffer> serialize(Publisher<T> source, BufferAllocator allocator, java.lang.Class<T> type, java.util.function.IntUnaryOperator bytesEstimator)
Publisher
such that each contained element of type T
is serialized into
a Buffer
.T
- The data type to serialize.source
- Publisher
containing objects to serialize.allocator
- The BufferAllocator
used to allocate Buffer
s.type
- The class for T
, the object to be serialized.bytesEstimator
- An IntUnaryOperator
that given the last serialized size in bytes, estimates the
size of the next object to be serialized in bytes.Publisher
such that each contained element in the original Publisher
is
transformed from type T
to a Buffer
.<T> java.lang.Iterable<Buffer> serialize(java.lang.Iterable<T> source, BufferAllocator allocator, java.lang.Class<T> type, java.util.function.IntUnaryOperator bytesEstimator)
Iterable
such that each contained element of type T
is serialized into
a Buffer
.T
- The data type to serialize.source
- Iterable
containing objects to serialize.allocator
- The BufferAllocator
used to allocate Buffer
s.type
- The class for T
, the object to be serialized.bytesEstimator
- An IntUnaryOperator
that given the last serialized size in bytes, estimates the
size of the next object to be serialized in bytes.Iterable
such that each contained element in the original Iterable
is
transformed from type T
to a Buffer
.<T> BlockingIterable<Buffer> serialize(BlockingIterable<T> source, BufferAllocator allocator, java.lang.Class<T> type, java.util.function.IntUnaryOperator bytesEstimator)
BlockingIterable
such that each contained element of type T
is serialized
into a Buffer
.T
- The data type to serialize.
size of the next object to be serialized in bytes.source
- BlockingIterable
containing objects to serialize.allocator
- The BufferAllocator
used to allocate Buffer
s.type
- The class for T
, the object to be serialized.bytesEstimator
- An IntUnaryOperator
that given the last serialized size in bytes, estimates theBlockingIterable
such that each contained element in the original
BlockingIterable
is transformed from type T
to a Buffer
.<T> Publisher<Buffer> serialize(Publisher<T> source, BufferAllocator allocator, TypeHolder<T> typeHolder)
Publisher
such that each contained element of type T
is serialized into
a Buffer
.T
- The data type to serialize.source
- Publisher
containing objects to serialize.allocator
- The BufferAllocator
used to allocate Buffer
s.typeHolder
- TypeHolder
holding the ParameterizedType
to be serialized.Publisher
such that each contained element in the original Publisher
is
transformed from type T
to a Buffer
.<T> java.lang.Iterable<Buffer> serialize(java.lang.Iterable<T> source, BufferAllocator allocator, TypeHolder<T> typeHolder)
Iterable
such that each contained element of type T
is serialized into
a Buffer
.T
- The data type to serialize.source
- Iterable
containing objects to serialize.allocator
- The BufferAllocator
used to allocate Buffer
s.typeHolder
- TypeHolder
holding the ParameterizedType
to be serialized.Iterable
such that each contained element in the original Iterable
is
transformed from type T
to a Buffer
.<T> BlockingIterable<Buffer> serialize(BlockingIterable<T> source, BufferAllocator allocator, TypeHolder<T> typeHolder)
BlockingIterable
such that each contained element of type T
is serialized
into a Buffer
.T
- The data type to serialize.source
- BlockingIterable
containing objects to serialize.allocator
- The BufferAllocator
used to allocate Buffer
s.typeHolder
- TypeHolder
holding the ParameterizedType
to be serialized.BlockingIterable
such that each contained element in the original
BlockingIterable
is transformed from type T
to a Buffer
.<T> Publisher<Buffer> serialize(Publisher<T> source, BufferAllocator allocator, TypeHolder<T> typeHolder, java.util.function.IntUnaryOperator bytesEstimator)
Publisher
such that each contained element of type T
is serialized into
a Buffer
.T
- The data type to serialize.source
- Publisher
containing objects to serialize.allocator
- The BufferAllocator
used to allocate Buffer
s.typeHolder
- TypeHolder
holding the ParameterizedType
to be serialized.bytesEstimator
- An IntUnaryOperator
that given the last serialized size in bytes, estimates the
size of the next object to be serialized in bytes.Publisher
such that each contained element in the original Publisher
is
transformed from type T
to a Buffer
.<T> java.lang.Iterable<Buffer> serialize(java.lang.Iterable<T> source, BufferAllocator allocator, TypeHolder<T> typeHolder, java.util.function.IntUnaryOperator bytesEstimator)
Iterable
such that each contained element of type T
is serialized into
a Buffer
.T
- The data type to serialize.source
- Iterable
containing objects to serialize.allocator
- The BufferAllocator
used to allocate Buffer
s.typeHolder
- TypeHolder
holding the ParameterizedType
to be serialized.bytesEstimator
- An IntUnaryOperator
that given the last serialized size in bytes, estimates the
size of the next object to be serialized in bytes.Iterable
such that each contained element in the original Iterable
is
transformed from type T
to a Buffer
.<T> BlockingIterable<Buffer> serialize(BlockingIterable<T> source, BufferAllocator allocator, TypeHolder<T> typeHolder, java.util.function.IntUnaryOperator bytesEstimator)
BlockingIterable
such that each contained element of type T
is serialized
into a Buffer
.T
- The data type to serialize.source
- BlockingIterable
containing objects to serialize.allocator
- The BufferAllocator
used to allocate Buffer
s.typeHolder
- TypeHolder
holding the ParameterizedType
to be serialized.bytesEstimator
- An IntUnaryOperator
that given the last serialized size in bytes, estimates the
size of the next object to be serialized in bytes.BlockingIterable
such that each contained element in the original
BlockingIterable
is transformed from type T
to a Buffer
.<T> Buffer serialize(T toSerialize, BufferAllocator allocator)
toSerialize
to the returned Buffer
.T
- The data type to serialize.toSerialize
- Object to serialize.allocator
- BufferAllocator
to allocate the returned Buffer
.Buffer
containing the serialized representation of toSerialize
.<T> Buffer serialize(T toSerialize, BufferAllocator allocator, int bytesEstimate)
toSerialize
to the returned Buffer
.T
- The data type to serialize.toSerialize
- Object to serialize.allocator
- BufferAllocator
to allocate the returned Buffer
.bytesEstimate
- An estimate for the size in bytes of the serialized representation of toSerialize
.Buffer
containing the serialized representation of toSerialize
.<T> void serialize(T toSerialize, Buffer destination)
toSerialize
to the passed Buffer
.T
- The data type to serialize.toSerialize
- Object to serialize.destination
- The Buffer
to which the serialized representation of toSerialize
is written.<T> Publisher<T> deserialize(Publisher<Buffer> source, TypeHolder<T> typeHolder)
Publisher
to convert into a Publisher
of deserialized
instances of T
. If the source
Publisher
terminates with some left over data in a
previously emitted Buffer
but not deserialized in an object, then the returned Publisher
will
terminate with an error.
If all content has been aggregated into a single Buffer
, deserializeAggregated(Buffer, Class)
can be used.
T
- The data type to deserialize.source
- Publisher
containing Buffer
s to deserialize.typeHolder
- TypeHolder
holding the ParameterizedType
to be deserialized.Publisher
such that each contained element in the original Publisher
is
transformed from type Buffer
to an instance of T
.<T> CloseableIterable<T> deserialize(java.lang.Iterable<Buffer> source, TypeHolder<T> typeHolder)
Iterable
to convert into a Iterable
of deserialized
instances of T
. If the source
Iterable
completes with some left over data in a
previously emitted Buffer
but not deserialized in an object, then Iterator
from the returned
Iterable
will throw an SerializationException
from Iterator.hasNext()
after all
deserialized instances are emitted.
If all content has been aggregated into a single Buffer
,
deserializeAggregated(Buffer, TypeHolder)
can be used.
T
- The data type to deserialize.source
- Iterable
containing Buffer
s to deserialize.typeHolder
- TypeHolder
holding the ParameterizedType
to be deserialized.CloseableIterable
such that each contained element in the original Iterable
is transformed from type Buffer
to an instance of T
.<T> BlockingIterable<T> deserialize(BlockingIterable<Buffer> source, TypeHolder<T> typeHolder)
BlockingIterable
to convert into a BlockingIterable
of
deserialized instances of T
. If the source
BlockingIterable
completes with some left
over data in a previously emitted Buffer
but not deserialized in an object, then BlockingIterator
from the returned BlockingIterable
will throw an SerializationException
from
Iterator.hasNext()
after all deserialized instances are emitted.
If all content has been aggregated into a single Buffer
, deserializeAggregated(Buffer, Class)
can be used.
T
- The data type to deserialize.source
- BlockingIterable
containing Buffer
s to deserialize.typeHolder
- TypeHolder
holding the ParameterizedType
to be deserialized.BlockingIterable
such that each contained element in the original
BlockingIterable
is transformed from type Buffer
to an instance of T
.<T> Publisher<T> deserialize(Publisher<Buffer> source, java.lang.Class<T> type)
Publisher
to convert into a Publisher
of deserialized
instances of T
. If the source
Publisher
terminates with some left over data in a
previously emitted Buffer
but not deserialized in an object, then the returned Publisher
will
terminate with an error.
If all content has been aggregated into a single Buffer
, deserializeAggregated(Buffer, Class)
can be used.
T
- The data type to deserialize.source
- Publisher
containing Buffer
s to deserialize.type
- The class for T
, the object to be deserialized.Publisher
such that each contained element in the original Publisher
is
transformed from type Buffer
to an instance of T
.<T> CloseableIterable<T> deserialize(java.lang.Iterable<Buffer> source, java.lang.Class<T> type)
Iterable
to convert into a CloseableIterable
of deserialized
instances of T
. If the source
Iterable
completes with some left over data in a
previously emitted Buffer
but not deserialized in an object, then CloseableIterator
from the
returned CloseableIterable
will throw an SerializationException
from
Iterator.hasNext()
after all deserialized instances are emitted.
If all content has been aggregated into a single Buffer
, deserializeAggregated(Buffer, Class)
can be used.
T
- The data type to deserialize.source
- Iterable
containing Buffer
s to deserialize.type
- The class for T
, the object to be deserialized.CloseableIterable
such that each contained element in the original Iterable
is transformed from type Buffer
to an instance of T
.<T> BlockingIterable<T> deserialize(BlockingIterable<Buffer> source, java.lang.Class<T> type)
BlockingIterable
to convert into a Iterable
of deserialized
instances of T
. If the source
BlockingIterable
completes with some left over data in a
previously emitted Buffer
but not deserialized in an object, then BlockingIterator
from the
returned BlockingIterable
will throw an SerializationException
from
Iterator.hasNext()
after all deserialized instances are emitted.
If all content has been aggregated into a single Buffer
, deserializeAggregated(Buffer, Class)
can be used.
T
- The data type to deserialize.source
- BlockingIterable
containing Buffer
s to deserialize.type
- The class for T
, the object to be deserialized.BlockingIterable
such that each contained element in the original
BlockingIterable
is transformed from type Buffer
to an instance of T
.<T> CloseableIterable<T> deserializeAggregated(Buffer serializedData, java.lang.Class<T> type)
Buffer
to one or more instances of T
.
Buffer
contains exact amount of data required to deserialize into
at least one complete instance of T
. If there is any left over data in the Buffer
after the
deserialization is complete, Iterator.hasNext()
and Iterator.next()
methods
will eventually throw a SerializationException
from the CloseableIterator
returned by
CloseableIterable.iterator()
. In such a case, all deserialized data will first be returned from the
CloseableIterator
.T
- The data type to deserialize.serializedData
- A Buffer
containing serialized representation of one or more instances of
T
.type
- The class for T
, the object to be deserialized.CloseableIterable
containing one or more deserialized instances of T
. If there is any
left over data in the Buffer
after the deserialization is complete, Iterator.hasNext()
and Iterator.next()
methods will eventually throw a SerializationException
from the
CloseableIterator
returned by CloseableIterable.iterator()
. In such a case, all deserialized
data will first be returned from the Iterator
.<T> CloseableIterable<T> deserializeAggregated(Buffer serializedData, TypeHolder<T> typeHolder)
Buffer
to zero or more instances of T
.
Buffer
contains exact amount of data required to deserialize into
at least one complete instance of T
. If there is any left over data in the Buffer
after
deserialization is complete, Iterator.hasNext()
and Iterator.next()
methods
will eventually throw a SerializationException
from the CloseableIterator
returned by
CloseableIterable.iterator()
. In such a case, all deserialized data will first be returned from the
CloseableIterator
.T
- The data type to deserialize.serializedData
- A Buffer
containing serialized representation of one or more instances of
T
.typeHolder
- TypeHolder
holding the ParameterizedType
to be deserialized.CloseableIterable
containing one or more deserialized instances of T
. If there is any
left over data in the Buffer
after the deserialization is complete, Iterator.hasNext()
and Iterator.next()
methods will eventually throw a SerializationException
from the
CloseableIterator
returned by CloseableIterable.iterator()
. In such a case, all deserialized
data will first be returned from the CloseableIterator
.<T> T deserializeAggregatedSingle(Buffer serializedData, java.lang.Class<T> type)
Buffer
to a single instance of T
.T
- The data type to deserialize.serializedData
- A Buffer
containing serialized representation of a single instance of T
.type
- The class for T
, the object to be deserialized.SerializationException
- If the passed Buffer
contains an incomplete object or if there is any
left over data in the Buffer
after the deserialization is complete.<T> T deserializeAggregatedSingle(Buffer serializedData, TypeHolder<T> typeHolder)
Buffer
to a single instance of T
.T
- The data type to deserialize.serializedData
- A Buffer
containing serialized representation of a single instance of T
.typeHolder
- TypeHolder
holding the ParameterizedType
to be deserialized.SerializationException
- If the passed Buffer
contains an incomplete object or if there is any
left over data in the Buffer
after the deserialization is complete.