Package-level declarations

Types

Link copied to clipboard
typealias ApolloJsonElement = Any?

A typealias for a type-unsafe Kotlin representation of JSON. This typealias is mainly for internal documentation purposes and low-level manipulations and should generally be avoided in application code.

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 DynamicJsJsonReader(val root: dynamic, pathRoot: Array<Any> = emptyArray())

A JsonReader that reads data from a javascript dynamic

Link copied to clipboard
interface IteratorWrapper

By wrapping each iterator we can use introspection to determine what kind of iterator we have in the stack

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: Any?, pathRoot: List<Any> = emptyList()) : JsonReader

A JsonReader that can consumes ApolloJsonElement values as Json

Link copied to clipboard

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 BufferedSource.jsonReader(): JsonReader
Link copied to clipboard

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

Link copied to clipboard
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)