Package-level declarations
Types
Link copied to clipboard
open class TypedSerializer<T : Any>(kClass: KClass<T>, presetSerializers: Map<String, KSerializer<out T>> = emptyMap()) : KSerializer<T>
A serializer that includes type information in the serialized output. This allows polymorphic serialization where the exact type is preserved in the output as a "type" field alongside the "value" field.
Functions
Link copied to clipboard
Removes a type from this TypedSerializer using its class name.
Link copied to clipboard
Adds a type to this TypedSerializer using its class name as the type identifier.
Link copied to clipboard
inline fun <T : Any> TypedSerializer(presetSerializers: Map<String, KSerializer<out T>> = emptyMap()): TypedSerializer<T>
Creates a TypedSerializer for the reified type T.
inline fun <T : Any> TypedSerializer(vararg presetSerializers: Pair<String, KSerializer<out T>>): TypedSerializer<T>
Creates a TypedSerializer for the reified type T with vararg preset serializers.