PresentAdapter
class PresentAdapter<T>(wrappedAdapter: Adapter<T>) : Adapter<Optional.Present<@JvmSuppressWildcards T>>
PresentAdapter can only express something that's present. Absent values are handled outside the adapter.
This adapter is used to handle optional arguments in operations and optional fields in Input objects.
Functions
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard
open override fun fromJson(reader: JsonReader, customScalarAdapters: CustomScalarAdapters): Optional.Present<T>
Deserializes the given Json to the expected Kotlin type.
Link copied to clipboard
open override fun toJson(writer: JsonWriter, customScalarAdapters: CustomScalarAdapters, value: Optional.Present<T>)
Serializes a Kotlin type into its equivalent Json representation.
Link copied to clipboard
fun <T> Adapter<T>.toJsonString(value: T, customScalarAdapters: CustomScalarAdapters = CustomScalarAdapters.Empty, indent: String? = null): String