Interface TypedSerializer<M>
- Type Parameters:
M
- the medium type
- All Superinterfaces:
AutoCloseable
,Serializer<M>
- All Known Implementing Classes:
TypedSerializer.Default
public interface TypedSerializer<M> extends Serializer<M>
Convenient API layer to use the binary persistence functionality for a serializer
that includes type informations in the serialized data.
It is based on a SerializerFoundation
, which can be configured to various needs.
Per default Binary
and byte[]
are supported as medium types.
The included type information can be configured by supplying a SerializerTypeInfoStrategy
using a SerializerTypeInfoStrategyCreator
to the SerializerFoundation
.
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static class
TypedSerializer.Default<M>
static class
TypedSerializer.Static
Nested classes/interfaces inherited from interface one.microstream.persistence.binary.util.Serializer
Serializer.Source, Serializer.Target
-
Method Summary
Static Methods Modifier and Type Method Description static Serializer<Binary>
Binary()
Create a new TypedSerializer instance using the default configuration.static Serializer<Binary>
Binary(SerializerFoundation<?> foundation)
Create a new TypedSerializer instance based upon the suppliedSerializerFoundation
.static Serializer<byte[]>
Bytes()
Create a new TypedSerializer instance using the default configuration.static Serializer<byte[]>
Bytes(SerializerFoundation<?> foundation)
Create a new TypedSerializer instance based upon the suppliedSerializerFoundation
.static <M> Serializer<M>
New(Function<Binary,M> toMedium, Function<M,Binary> toBinary)
static <M> Serializer<M>
New(SerializerFoundation<?> foundation, Function<Binary,M> toMedium, Function<M,Binary> toBinary)
Methods inherited from interface one.microstream.persistence.binary.util.Serializer
deserialize, serialize
-
Method Details
-
Binary
Create a new TypedSerializer instance using the default configuration. The serialized data is supplied as MicroStreamBinary
. The serializer will include the whole set of current type information in every serialized Binary.- Returns:
- A new TypedSerializer instance.
-
Binary
Create a new TypedSerializer instance based upon the suppliedSerializerFoundation
. The serialized data is supplied as byte array. The serializer will include the whole set of current type information in every serialized Binary.- Parameters:
foundation
- the foundation to base the serializer on- Returns:
- A new TypedSerializer instance.
-
Bytes
Create a new TypedSerializer instance using the default configuration. The serialized data is supplied as byte array. The serializer will include the whole set of current type information in every serialized byte array.- Returns:
- A new TypedSerializer instance.
-
Bytes
Create a new TypedSerializer instance based upon the suppliedSerializerFoundation
. The serialized data is supplied as byte array. The serializer will include the whole set of current type information in every serialized byte array.- Parameters:
foundation
-SerializerFoundation
used to configure the serializer instance.- Returns:
- A new TypedSerializer instance.
-
New
-
New
static <M> Serializer<M> New(SerializerFoundation<?> foundation, Function<Binary,M> toMedium, Function<M,Binary> toBinary)
-