class JSONPathTyped
        extends JSONPath {
    final JSONPath jsonPath;
    final Type type;
    protected JSONPathTyped(JSONPath jsonPath, Type type) {
        super(jsonPath.path, jsonPath.features);
        this.type = type;
        this.jsonPath = jsonPath;
    }

    @Override
    public JSONPath getParent() {
        return jsonPath.getParent();
    }

    @Override
    public boolean isRef() {
        return jsonPath.isRef();
    }

    @Override
    public boolean contains(Object object) {
        return jsonPath.contains(object);
    }

    @Override
    public Object eval(Object object) {
        Object result = jsonPath.eval(object);
        return TypeUtils.cast(result, type);
    }

    @Override
    public Object extract(JSONReader jsonReader) {
        Object result = jsonPath.extract(jsonReader);
        return TypeUtils.cast(result, type);
    }

    @Override
    public String extractScalar(JSONReader jsonReader) {
        return jsonPath.extractScalar(jsonReader);
    }

    @Override
    public void set(Object object, Object value) {
        jsonPath.set(object, value);
    }

    @Override
    public void set(Object object, Object value, JSONReader.Feature... readerFeatures) {
        jsonPath.set(object, value, readerFeatures);
    }

    @Override
    public void setCallback(Object object, BiFunction callback) {
        jsonPath.setCallback(object, callback);
    }

    @Override
    public void setInt(Object object, int value) {
        jsonPath.setInt(object, value);
    }

    @Override
    public void setLong(Object object, long value) {
        jsonPath.setLong(object, value);
    }

    @Override
    public boolean remove(Object object) {
        return jsonPath.remove(object);
    }

    public Type getType() {
        return type;
    }

    public static JSONPath of(JSONPath jsonPath, Type type) {<FILL_FUNCTION_BODY>}
}

        if (type == null || type == Object.class) {
            return jsonPath;
        }

        if (jsonPath instanceof JSONPathTyped) {
            JSONPathTyped jsonPathTyped = (JSONPathTyped) jsonPath;
            if (jsonPathTyped.type.equals(type)) {
                return jsonPath;
            }
        }

        if (jsonPath instanceof JSONPathSingleName) {
            if (type == Integer.class) {
                return new JSONPathSingleNameInteger((JSONPathSingleName) jsonPath);
            }

            if (type == Long.class) {
                return new JSONPathSingleNameLong((JSONPathSingleName) jsonPath);
            }

            if (type == String.class) {
                return new JSONPathSingleNameString((JSONPathSingleName) jsonPath);
            }

            if (type == BigDecimal.class) {
                return new JSONPathSingleNameDecimal((JSONPathSingleName) jsonPath);
            }
        }

        return new JSONPathTyped(jsonPath, type);
    
<methods>public transient void arrayAdd(java.lang.Object, java.lang.Object[]) ,public static com.alibaba.fastjson2.JSONPath compile(java.lang.String) ,public static com.alibaba.fastjson2.JSONPath compile(java.lang.String, Class#RAW) ,public static boolean contains(java.lang.Object, java.lang.String) ,public abstract boolean contains(java.lang.Object) ,public boolean endsWithFilter() ,public static java.lang.Object eval(java.lang.String, java.lang.String) ,public static java.lang.Object eval(java.lang.Object, java.lang.String) ,public abstract java.lang.Object eval(java.lang.Object) ,public static java.lang.Object extract(java.lang.String, java.lang.String) ,public static transient java.lang.Object extract(java.lang.String, java.lang.String, com.alibaba.fastjson2.JSONPath.Feature[]) ,public java.lang.Object extract(java.lang.String) ,public java.lang.Object extract(byte[]) ,public java.lang.Object extract(byte[], int, int, java.nio.charset.Charset) ,public abstract java.lang.Object extract(com.alibaba.fastjson2.JSONReader) ,public void extract(com.alibaba.fastjson2.JSONReader, com.alibaba.fastjson2.reader.ValueConsumer) ,public java.lang.Integer extractInt32(com.alibaba.fastjson2.JSONReader) ,public int extractInt32Value(com.alibaba.fastjson2.JSONReader) ,public java.lang.Long extractInt64(com.alibaba.fastjson2.JSONReader) ,public long extractInt64Value(com.alibaba.fastjson2.JSONReader) ,public abstract java.lang.String extractScalar(com.alibaba.fastjson2.JSONReader) ,public void extractScalar(com.alibaba.fastjson2.JSONReader, com.alibaba.fastjson2.reader.ValueConsumer) ,public abstract com.alibaba.fastjson2.JSONPath getParent() ,public com.alibaba.fastjson2.JSONReader.Context getReaderContext() ,public com.alibaba.fastjson2.JSONWriter.Context getWriterContext() ,public boolean isPrevious() ,public abstract boolean isRef() ,public static com.alibaba.fastjson2.JSONPath of(java.lang.String) ,public static com.alibaba.fastjson2.JSONPath of(java.lang.String, java.lang.reflect.Type) ,public static transient com.alibaba.fastjson2.JSONPath of(java.lang.String, java.lang.reflect.Type, com.alibaba.fastjson2.JSONPath.Feature[]) ,public static com.alibaba.fastjson2.JSONPath of(java.lang.String[], java.lang.reflect.Type[]) ,public static transient com.alibaba.fastjson2.JSONPath of(java.lang.String[], java.lang.reflect.Type[], com.alibaba.fastjson2.JSONReader.Feature[]) ,public static transient com.alibaba.fastjson2.JSONPath of(java.lang.String[], java.lang.reflect.Type[], java.lang.String[], long[], java.time.ZoneId, com.alibaba.fastjson2.JSONReader.Feature[]) ,public static transient com.alibaba.fastjson2.JSONPath of(java.lang.String, com.alibaba.fastjson2.JSONPath.Feature[]) ,public static Map<java.lang.String,java.lang.Object> paths(java.lang.Object) ,public static java.lang.String remove(java.lang.String, java.lang.String) ,public static void remove(java.lang.Object, java.lang.String) ,public abstract boolean remove(java.lang.Object) ,public static java.lang.String set(java.lang.String, java.lang.String, java.lang.Object) ,public static java.lang.Object set(java.lang.Object, java.lang.String, java.lang.Object) ,public abstract void set(java.lang.Object, java.lang.Object) ,public transient abstract void set(java.lang.Object, java.lang.Object, com.alibaba.fastjson2.JSONReader.Feature[]) ,public static java.lang.Object setCallback(java.lang.Object, java.lang.String, Function#RAW) ,public static java.lang.Object setCallback(java.lang.Object, java.lang.String, BiFunction#RAW) ,public void setCallback(java.lang.Object, Function#RAW) ,public abstract void setCallback(java.lang.Object, BiFunction#RAW) ,public abstract void setInt(java.lang.Object, int) ,public abstract void setLong(java.lang.Object, long) ,public com.alibaba.fastjson2.JSONPath setReaderContext(com.alibaba.fastjson2.JSONReader.Context) ,public com.alibaba.fastjson2.JSONPath setWriterContext(com.alibaba.fastjson2.JSONWriter.Context) ,public final java.lang.String toString() <variables>static final com.alibaba.fastjson2.JSONReader.Context PARSE_CONTEXT,final non-sealed long features,final non-sealed java.lang.String path,com.alibaba.fastjson2.JSONReader.Context readerContext,com.alibaba.fastjson2.JSONWriter.Context writerContext