ApolloOptionalAdapter

class ApolloOptionalAdapter<T>(wrappedAdapter: Adapter<T>) : Adapter<Optional<@JvmSuppressWildcards T>>

This adapter is used to handle nullable fields when they are represented as Optional. null is deserialized as Optional.Absent.

Constructors

Link copied to clipboard
fun <T> ApolloOptionalAdapter(wrappedAdapter: Adapter<T>)

Functions

Link copied to clipboard
open override fun fromJson(reader: JsonReader, customScalarAdapters: CustomScalarAdapters): Optional<T>

Deserializes the given Json to the expected Kotlin type.

Link copied to clipboard
open override fun toJson(    writer: JsonWriter,     customScalarAdapters: CustomScalarAdapters,     value: Optional<T>)

Serializes a Kotlin type into its equivalent Json representation.