PolymorphicAdapter

class PolymorphicAdapter<T : Any> : JsonDeserializer<T> , JsonSerializer<T>

Provides an adapter that stores the classname with the object being serialized. This allows for the object to be properly deserialized even when being serialized into a base class or interface.

Constructors

Link copied to clipboard
constructor()

Functions

Link copied to clipboard
open override fun deserialize(json: JsonElement, typeOfT: Type, context: JsonDeserializationContext): T?
Link copied to clipboard
open override fun serialize(src: T, typeOfSrc: Type, context: JsonSerializationContext): JsonElement