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 and discovering SPI modules.

Functions

Link copied to clipboard
open fun <T> of(typeReference: TypeReference<T>): Serde<T>
open fun <T> of(mapper: ObjectMapper, typeReference: TypeReference<T>): Serde<T>
Serialize/Deserialize TypeReference using the default object mapper.
open fun <T> of(clazz: Class<T>): Serde<T>
Serialize/Deserialize class using the default object mapper.
open fun <T> of(mapper: ObjectMapper, clazz: Class<T>): Serde<T>
Serialize/Deserialize class using the provided object mapper.