JavaOptionalAdapter

class JavaOptionalAdapter<T : Any>(wrappedAdapter: Adapter<T>) : Adapter<Optional<T>>

An adapter for Java's Optional. null is deserialized as Optional.empty.

Constructors

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

Functions

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