M - the medium typepublic interface Serializer<M> extends AutoCloseable
It is based on a SerializerFoundation, which can be configured to various needs.
Per default Binary and byte[] are supported as medium types.
| Modifier and Type | Interface and Description |
|---|---|
static class |
Serializer.Default<M> |
static interface |
Serializer.Source |
static class |
Serializer.Static |
static interface |
Serializer.Target |
| Modifier and Type | Method and Description |
|---|---|
static Serializer<Binary> |
Binary() |
static Serializer<Binary> |
Binary(SerializerFoundation<?> foundation) |
static Serializer<byte[]> |
Bytes() |
static Serializer<byte[]> |
Bytes(SerializerFoundation<?> foundation) |
<T> T |
deserialize(M medium)
Recreates an object graph based on the given data.
|
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) |
M |
serialize(Object object)
Serializes the given object graph into the medium type.
|
closeM serialize(Object object)
object - the graph's root<T> T deserialize(M medium)
T - the object's typemedium - the medium to read fromstatic Serializer<Binary> Binary()
static Serializer<Binary> Binary(SerializerFoundation<?> foundation)
static Serializer<byte[]> Bytes()
static Serializer<byte[]> Bytes(SerializerFoundation<?> foundation)
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)
Copyright © 2022 MicroStream Software. All rights reserved.