SerdeFactory

interface SerdeFactory

This factory creates Serde that are used in various places of the SDK, notably:

  • To deserialize handler's input and deserialize the output
  • To serialize and deserialize state, awakeables, promises and so on
When using the Java APIs, a Jackson based implementation is used by default, see in sdk-serde-jackson module.

When using the Kotlin APIs, a Kotlin Serialization implementation is used by default, see dev.restate.serde.kotlinx.KotlinSerializationSerdeFactory in sdk-api-kotlin module.

You can override the default factory used for a given service by adding the annotation on the interface/class annotated with /dev.restate.sdk.annotation.VirtualObject/

Implementations MUST be thread safe.

Properties

Link copied to clipboard
Noop factory, that will throw UnsupportedOperationException when called.

Functions

Link copied to clipboard
abstract fun <T> create(typeRef: TypeRef<T>): Serde<T>
open fun <T> create(typeTag: TypeTag<T>): Serde<T>
abstract fun <T> create(clazz: Class<T>): Serde<T>