promoteNameToValue

abstract fun promoteNameToValue()

Changes the reader to treat the next name as a string value. This is useful for map adapters so that arbitrary type adapters can use nextString to read a name value.

In this example, calling this method allows two sequential calls to nextString:

JsonReader reader = JsonReader.of(new Buffer().writeUtf8("{\"a\":\"b\"}"));
reader.beginObject();
reader.promoteNameToValue();
assertEquals("a", reader.nextString());
assertEquals("b", reader.nextString());
reader.endObject();