class JSONPathSingle
        extends JSONPath {
    final JSONPathSegment segment;
    final boolean ref;
    final boolean extractSupport;

    JSONPathSingle(JSONPathSegment segment, String path, Feature... features) {
        super(path, features);
        this.segment = segment;
        this.ref = segment instanceof JSONPathSegmentIndex || segment instanceof JSONPathSegmentName;

        boolean extractSupport = true;
        if (segment instanceof JSONPathSegment.EvalSegment) {
            extractSupport = false;
        } else if (segment instanceof JSONPathSegmentIndex && ((JSONPathSegmentIndex) segment).index < 0) {
            extractSupport = false;
        } else if (segment instanceof JSONPathSegment.CycleNameSegment && ((JSONPathSegment.CycleNameSegment) segment).shouldRecursive()) {
            extractSupport = false;
        }
        this.extractSupport = extractSupport;
    }

    @Override
    public boolean remove(Object root) {
        Context context = new Context(this, null, segment, null, 0);
        context.root = root;
        return segment.remove(context);
    }

    @Override
    public boolean contains(Object root) {
        Context context = new Context(this, null, segment, null, 0);
        context.root = root;
        return segment.contains(context);
    }

    @Override
    public boolean isRef() {
        return ref;
    }

    @Override
    public Object eval(Object root) {
        Context context = new Context(this, null, segment, null, 0);
        context.root = root;
        segment.eval(context);
        return context.value;
    }

    @Override
    public void set(Object root, Object value) {
        Context context = new Context(this, null, segment, null, 0);
        context.root = root;
        segment.set(context, value);
    }

    @Override
    public void set(Object root, Object value, JSONReader.Feature... readerFeatures) {
        Context context = new Context(this, null, segment, null, 0);
        context.root = root;
        segment.set(context, value);
    }

    @Override
    public void setCallback(Object root, BiFunction callback) {
        Context context = new Context(this, null, segment, null, 0);
        context.root = root;
        segment.setCallback(context, callback);
    }

    @Override
    public void setInt(Object root, int value) {<FILL_FUNCTION_BODY>}

    @Override
    public void setLong(Object root, long value) {
        Context context = new Context(this, null, segment, null, 0);
        context.root = root;
        segment.setLong(context, value);
    }

    @Override
    public Object extract(JSONReader jsonReader) {
        Context context = new Context(this, null, segment, null, 0);
        if (!extractSupport) {
            context.root = jsonReader.readAny();
            segment.eval(context);
        } else {
            segment.accept(jsonReader, context);
        }
        return context.value;
    }

    @Override
    public String extractScalar(JSONReader jsonReader) {
        Context context = new Context(this, null, segment, null, 0);
        segment.accept(jsonReader, context);
        return JSON.toJSONString(context.value);
    }

    @Override
    public final JSONPath getParent() {
        return RootPath.INSTANCE;
    }
}

        Context context = new Context(this, null, segment, null, 0);
        context.root = root;
        segment.setInt(context, value);
    
<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