RuntimeTypeAdapterFactory

class RuntimeTypeAdapterFactory<T> : TypeAdapterFactory

Functions

Link copied to clipboard
open fun <R> create(gson: Gson, type: TypeToken<R>): TypeAdapter<R>
Link copied to clipboard
open fun <T> of(baseType: Class<T>): RuntimeTypeAdapterFactory<T>
Creates a new runtime type adapter for baseType using "type" as the type field name.
open fun <T> of(baseType: Class<T>, typeFieldName: String): RuntimeTypeAdapterFactory<T>
open fun <T> of(baseType: Class<T>, typeFieldName: String, maintainType: Boolean): RuntimeTypeAdapterFactory<T>
Creates a new runtime type adapter using for baseType using typeFieldName as the type field name.
Link copied to clipboard
Registers type identified by its simple name.
open fun registerSubtype(type: Class<out T>, label: String): RuntimeTypeAdapterFactory<T>
Registers type identified by label.