MapJsonReader
A JsonReader that can consumes ApolloJsonElement values as Json
To read from a okio.BufferedSource, see also BufferedSourceJsonReader
Parameters
Functions
Consumes the next token from the JSON stream and asserts that it is the beginning of a new array.
Consumes the next token from the JSON stream and asserts that it is the beginning of a new object.
buffers the next Object. Has to be called in BEGIN_OBJECT
position. The returned MapJsonReader can use MapJsonReader.rewind to read fields multiple times
Consumes the next token from the JSON stream and asserts that it is the end of the current array.
Consumes the next token from the JSON stream and asserts that it is the end of the current object.
Returns the Token.BOOLEAN value of the next token, consuming it.
Returns the Token.NUMBER value of the next token, consuming it.
Returns the Token.NUMBER value of the next token, consuming it.
Returns the Token.STRING value of the next token, consuming it.
Reads a ApolloResponse from this. The caller is responsible for closing this.
Returns the type of the next token without consuming it.
Returns the Kotlin representation of the given JsonReader
An optimized way to retrieve the nextName when the candidates and their order is known. selectName maintains the current index in the list and saves having to string compare nextName to every candidate.
Reads a single ApolloResponse from this. Returns an error response if this contains more than one JSON response or trailing tokens. toApolloResponse takes ownership and closes this.