private <T> T readNameOrValue(TypedParser<T> ch) {
        final JsonNode elem = getCurrentContext().getCurrentChild();
        if (getCurrentContext().isMapKey()) {
            // Will throw a ClassCastException if this is not a JsonPrimitive string
            return ch.readFromString(elem.asText());
        } else {
            return ch.readFromJsonElement(elem);
        }
    }
Read in a value of the given type, either as a name (meaning the
JSONElement is a string and we convert it), or as a value
(meaning the JSONElement has the type we expect).
Uses a TypedParser to do the real work.
thrift/thrift0.13/src/main/java/com/linecorp/armeria/common/thrift/text/TTextProtocol.java