static <T> T to(Class<T> clazz, Object object) {
        if (object == null) {
            return null;
        }

        if (object instanceof JSONObject) {
            return ((JSONObject) object).to(clazz);
        }

        return TypeUtils.cast(object, clazz, JSONFactory.getDefaultObjectReaderProvider());
    }
Converts the specified object to an object of the specified goal type

@param clazz the specified goal class
@param object the specified object to be converted
@since 2.0.4
core/src/main/java/com/alibaba/fastjson2/JSON.java