promote Name To Value
abstract fun promoteNameToValue()
Content copied to clipboard
Changes the reader to treat the next name as a string value. This is useful for map adapters sothat arbitrary type adapters can use nextString to read a name value.
In this example, calling this method allows two sequential calls to nextString:
{@code * JsonReader reader = JsonReader.of(new Buffer().writeUtf8("{\"a\":\"b\"}")); * reader.beginObject(); * reader.promoteNameToValue(); * assertEquals("a", reader.nextString()); * assertEquals("b", reader.nextString()); * reader.endObject(); * }