Package com.apollographql.apollo3.api.json

Types

Link copied to clipboard
class BufferedSinkJsonWriter @JvmOverloads constructor(sink: BufferedSink, indent: String? = null) : JsonWriter

A JsonWriter that writes json to an okio BufferedSink

Link copied to clipboard
class BufferedSourceJsonReader(source: BufferedSource) : JsonReader

A JsonWriter that reads json from an okio BufferedSource

Link copied to clipboard
class JsonNumber(val value: String)

A simple wrapper class that can be put in Map to indicate an arbitrary precision json number

Link copied to clipboard
interface JsonReader : Closeable

Reads a JSON RFC 7159 encoded value as a stream of tokens.

Link copied to clipboard
interface JsonWriter : Closeable

Writes a JSON RFC 7159 encoded value to a stream, one token at a time.

Link copied to clipboard
class MapJsonReader @JvmOverloads constructor(val root: Map<String, Any?>, pathRoot: List<Any> = emptyList()) : JsonReader

A JsonReader that reads data from a regular Map

Link copied to clipboard
class MapJsonWriter : JsonWriter

A JsonWriter that writes data to a Map

Functions

Link copied to clipboard
inline fun buildJsonByteString(indent: String? = null, crossinline block: JsonWriter.() -> Unit): ByteString
Link copied to clipboard
inline fun buildJsonMap(crossinline block: JsonWriter.() -> Unit): Any?
Link copied to clipboard
inline fun buildJsonString(indent: String? = null, crossinline block: JsonWriter.() -> Unit): String
Link copied to clipboard
fun Map<String, Any?>.jsonReader(): JsonReader
fun BufferedSource.jsonReader(): JsonReader
Link copied to clipboard
fun JsonReader.readAny(): Any?

Reads the reader and maps numbers to the closest representation possible in that order:

Link copied to clipboard
fun JsonReader.readTypename(): String
Link copied to clipboard
fun JsonWriter.writeAny(value: Any?)
Link copied to clipboard
inline fun JsonWriter.writeArray(crossinline block: JsonWriter.() -> Unit)
Link copied to clipboard
inline fun JsonWriter.writeObject(crossinline block: JsonWriter.() -> Unit)