Package dev.restate.sdk.serde.jackson
Class JacksonSerdes
java.lang.Object
dev.restate.sdk.serde.jackson.JacksonSerdes
Serde
implementations for Jackson.
You can use these serdes for serializing and deserializing state, side effects results and
awakeables using Jackson's ObjectMapper
.
For example:
private static final StateKey<Person> PERSON = StateKey.of("person", JacksonSerdes.of(Person.class));
Or using Jackson's TypeReference
to encapsulate generics:
private static final StateKey<List<Person>> PEOPLE = StateKey.of("people", JacksonSerdes.of(new TypeReference<>() {}));
When no object mapper is provided, a default one is used, using the default JsonFactory
and discovering SPI modules.-
Method Summary
Modifier and TypeMethodDescriptionstatic <T> Serde
<T> of
(com.fasterxml.jackson.core.type.TypeReference<T> typeReference) Serialize/DeserializeTypeReference
using the default object mapper.static <T> Serde
<T> of
(com.fasterxml.jackson.databind.ObjectMapper mapper, com.fasterxml.jackson.core.type.TypeReference<T> typeReference) Serialize/DeserializeTypeReference
using the default object mapper.static <T> Serde
<T> Serialize/Deserialize class using the provided object mapper.static <T> Serde
<T> Serialize/Deserialize class using the default object mapper.
-
Method Details
-
of
Serialize/Deserialize class using the default object mapper. -
of
Serialize/Deserialize class using the provided object mapper. -
of
Serialize/DeserializeTypeReference
using the default object mapper. -
of
public static <T> Serde<T> of(com.fasterxml.jackson.databind.ObjectMapper mapper, com.fasterxml.jackson.core.type.TypeReference<T> typeReference) Serialize/DeserializeTypeReference
using the default object mapper.
-