class FieldWriterInt32ValFunc
        extends FieldWriterInt32 {
    final ToIntFunction function;

    FieldWriterInt32ValFunc(
            String fieldName,
            int ordinal,
            long features,
            String format,
            String label,
            Field field,
            Method method,
            ToIntFunction function
    ) {
        super(fieldName, ordinal, features, format, label, int.class, int.class, field, method);
        this.function = function;
    }

    @Override
    public Object getFieldValue(Object object) {
        return function.applyAsInt(object);
    }

    @Override
    public boolean write(JSONWriter jsonWriter, Object object) {<FILL_FUNCTION_BODY>}

    @Override
    public void writeValue(JSONWriter jsonWriter, Object object) {
        int value = function.applyAsInt(object);
        jsonWriter.writeInt32(value);
    }
}

        int value;
        try {
            value = function.applyAsInt(object);
        } catch (RuntimeException error) {
            if (jsonWriter.isIgnoreErrorGetter()) {
                return false;
            }
            throw error;
        }

        writeInt32(jsonWriter, value);
        return true;
    
<methods>public ObjectWriter#RAW getObjectWriter(com.alibaba.fastjson2.JSONWriter, Class#RAW) ,public boolean write(com.alibaba.fastjson2.JSONWriter, java.lang.Object) ,public final void writeInt32(com.alibaba.fastjson2.JSONWriter, int) ,public void writeValue(com.alibaba.fastjson2.JSONWriter, java.lang.Object) <variables>final non-sealed boolean toString