class FieldWriterInt64ValFunc<T>
        extends FieldWriterInt64<T> {
    final ToLongFunction function;

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

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

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

    @Override
    public void writeValue(JSONWriter jsonWriter, T object) {
        long value = function.applyAsLong(object);
        jsonWriter.writeInt64(value);
    }
}

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

        writeInt64(jsonWriter, value);
        return true;
    
<methods>public boolean write(com.alibaba.fastjson2.JSONWriter, T) ,public final void writeInt64(com.alibaba.fastjson2.JSONWriter, long) ,public void writeValue(com.alibaba.fastjson2.JSONWriter, T) <variables>final non-sealed boolean browserCompatible