RichSerde

interface RichSerde<T> : Serde<T>

Richer version of Serde containing schema information.

This API should be considered unstable to implement.

You can create one using withSchema.

Properties

Link copied to clipboard
Link copied to clipboard
Pass through Serde for byte array.
Link copied to clipboard
val VOID: Serde<@Nullable Void>
Noop Serde for void.

Functions

Link copied to clipboard
@Nullable
open fun contentType(): @Nullable String
Content-type to use in request/responses.
Link copied to clipboard
abstract fun deserialize(value: Array<Byte>): T
open fun deserialize(byteBuffer: ByteBuffer): T
Link copied to clipboard
abstract fun jsonSchema(): Any
Link copied to clipboard
abstract fun serialize(value: T): Array<Byte>
Link copied to clipboard
Link copied to clipboard
open fun <T> using(serializer: ThrowingFunction<T, Array<Byte>>, deserializer: ThrowingFunction<Array<Byte>, T>): Serde<@NonNull T>
Like using, using content-type application/octet-stream.
open fun <T> using(contentType: String, serializer: ThrowingFunction<T, Array<Byte>>, deserializer: ThrowingFunction<Array<Byte>, T>): Serde<@NonNull T>
Create a Serde from serializer/deserializer lambdas, tagging with contentType.
Link copied to clipboard
open fun <T> withContentType(contentType: String, inner: Serde<T>): Serde<T>
Link copied to clipboard
open fun <T> withSchema(jsonSchema: Any, inner: Serde<T>): RichSerde<T>