convert

abstract fun convert(source: T, expectedOid: Int, context: SerializationContext): Any

Converts a value this converter has claimed into something a codec can encode.

Nested values should go through SerializationContext.convert rather than being converted by hand, so that a failure deeper in the structure arrives with the path to it.

Return

A value some registered codec can encode.

Parameters

source

The value being sent.

expectedOid

The OID the server expects, or 0 when it is not yet known.

context

Access to the type manager and to nested conversion.