Serializer Registry
class SerializerRegistry
Thread-safe registry that maps Kotlin types to their TypeSerializer instances.
The registry uses a ConcurrentHashMap internally, so it is safe to read and write from multiple threads without external synchronization.
Example -- registering and retrieving serializers:
val registry = SerializerRegistry()
// Register built-in serializers
BuiltinSerializers.registerAll(registry)
// Register a custom serializer
registry.register(Instant::class, InstantSerializer)
// Retrieve a serializer
val intSerializer = registry.get(Int::class) // TypeSerializer<Int>?
val exists = registry.has(String::class) // trueContent copied to clipboard
Since
1.0
See also
Functions
Link copied to clipboard
Returns the TypeSerializer registered for the given klass, or null if none has been registered.
Link copied to clipboard
Registers a serializer for the given Kotlin klass.