ProtoBufSumTypeSerializer
@ExperimentalSerializationApi
A ProtoBuf KSerializer for sum types, aka, open/abstract/sealed classes and interfaces.
It's achieved by converting the object to a wrapper surrogate object SumTypeSupertypeSurrogate, in which the type is stored as a classifying Int number SumTypeSupertypeSurrogate.subtypeNumber.
Functions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
abstract fun getSubtypeNumberAndSubtypeSerializationStrategy(value: Supertype): Pair<Int, SerializationStrategy<*>>