register Serializer
Registers a custom TypeSerializer for the given type klass.
Custom serializers allow non-standard types to be serialized to and deserialized from YAML. Registered serializers take precedence over default data class serialization.
Example:
YamlConfigManager.registerSerializer(Duration::class, DurationSerializer)Content copied to clipboard
Since
1.0
Parameters
T
The type to register a serializer for.
klass
The KClass of the type.
serializer
The TypeSerializer implementation.
See also
Registers a custom TypeSerializer for the reified type T.
This is a convenience overload that infers the KClass from the reified type parameter.
Example:
YamlConfigManager.registerSerializer<Duration>(DurationSerializer)Content copied to clipboard
Since
1.0
Parameters
T
The type to register a serializer for.
serializer
The TypeSerializer implementation.