promoteValueToName

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

In this example, calling this method allows two sequential calls to value to produce the object, {@code {"a": "b"}} .

{@code * JsonWriter writer = JsonWriter.of(...); * writer.beginObject(); * writer.promoteValueToName(); * writer.value("a"); * writer.value("b"); * writer.endObject(); * }

fun promoteValueToName()