Fudge
08/06/2019, 9:34 AM@Serializable(with = ...::class)
whenever they use the data format?
For example, support UUID:
class MyEncoder : NamedValueEncoder {
fun encodeInt() { ... }
...
fun encodeUUID() { ... }
}
class MyDecoder : NamedValueDecoder {
fun decodeInt() { ... }
...
fun decodeUUID() { ... }
And then users can do:
@Serializable
data class OtherFormats(val uuid: UUID)
Instead of:
@Serializable
data class OtherFormats(@Serializable(with = UuidSerializer::class) val uuid: UUID)
(where UuidSerializer
is the name of a class annotated with @Serializer(forClass=UUID::class)
)Dominaezzz
08/06/2019, 9:41 AM@Serializer(forClass=UUID::class)
you can look into.Fudge
08/06/2019, 9:42 AM@Serializable(with = UuidSerializer::class)
Fudge
08/06/2019, 9:43 AMUuidSerializer
is the name of a class annotated with @Serializer(forClass=UUID::class)