@SuppressWarnings("unchecked")
    public <T> T to(Class<T> clazz, JSONReader.Feature... features) {
        long featuresValue = JSONFactory.defaultReaderFeatures | JSONReader.Feature.of(features);
        boolean fieldBased = JSONReader.Feature.FieldBased.isEnabled(featuresValue);

        if (clazz == String.class) {
            return (T) toString();
        }

        if (clazz == JSON.class) {
            return (T) this;
        }

        if (clazz == Void.class || clazz == void.class) {
            return null;
        }

        ObjectReaderProvider provider = JSONFactory.getDefaultObjectReaderProvider();
        ObjectReader<T> objectReader = provider.getObjectReader(clazz, fieldBased);
        return objectReader.createInstance(this, featuresValue);
    }
Convert this {@link JSONObject} to the specified Object

<pre>{@code
JSONObject obj = ...
User user = obj.to(User.class);
}</pre>

@param clazz specify the {@code Class<T>} to be converted
@param features features to be enabled in parsing
@since 2.0.4
core/src/main/java/com/alibaba/fastjson2/JSONObject.java