OptionalAdapter

class OptionalAdapter<T>(wrappedAdapter: Adapter<T>) : Adapter<Optional.Present<@JvmSuppressWildcards() T>>

ResponseAdapters can only express something that's present. Absent values are handled outside of the adapter

Constructors

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

Functions

fromJson
Link copied to clipboard
common
open override fun fromJson(reader: JsonReader, customScalarAdapters: CustomScalarAdapters): Optional.Present<T>
Deserializes the given Json to the expected Kotlin type.
toJson
Link copied to clipboard
common
open override fun toJson(writer: JsonWriter, customScalarAdapters: CustomScalarAdapters, value: Optional.Present<T>)
Serializes a Kotlin type into its equivalent Json representation.