AdapterMethodsFactory

class AdapterMethodsFactory : JsonAdapter.Factory

Constructors

AdapterMethodsFactory
Link copied to clipboard
open fun AdapterMethodsFactory(toAdapters: List<AdapterMethodsFactory.AdapterMethod>, fromAdapters: List<AdapterMethodsFactory.AdapterMethod>)

Types

AdapterMethod
Link copied to clipboard
abstract class AdapterMethod

Functions

create
Link copied to clipboard

Attempts to create an adapter for {@code type} annotated with {@code annotations} . This returns the adapter if one was created, or null if this factory isn't capable of creating such an adapter.

Implementations may use to compose adapters of other types, or to delegate to the underlying adapter of the same type.

open fun create(type: Type, annotations: Set<out Annotation>, moshi: Moshi): JsonAdapter<out Any>
abstract fun create(type: Type, annotations: Set<out Annotation>, moshi: Moshi): JsonAdapter<out Any>
fromAdapter
Link copied to clipboard

Returns an object that calls a {@code method} method on {@code adapter} in service of converting an object from JSON.

open fun fromAdapter(adapter: Any, method: Method): AdapterMethodsFactory.AdapterMethod
get
Link copied to clipboard
open fun get(adapter: Any): AdapterMethodsFactory
toAdapter
Link copied to clipboard

Returns an object that calls a {@code method} method on {@code adapter} in service of converting an object to JSON.

open fun toAdapter(adapter: Any, method: Method): AdapterMethodsFactory.AdapterMethod