class FieldWriterEnumMethod
        extends FieldWriterEnum {
    FieldWriterEnumMethod(
            String name,
            int ordinal,
            long features,
            String format,
            String label,
            Class fieldType,
            Field field,
            Method method
    ) {
        super(name, ordinal, features, format, label, fieldType, fieldType, field, method);
    }

    @Override
    public Object getFieldValue(Object object) {<FILL_FUNCTION_BODY>}

    @Override
    public boolean write(JSONWriter jsonWriter, Object object) {
        Enum value = (Enum) getFieldValue(object);

        if (value == null) {
            long features = this.features | jsonWriter.getFeatures();
            if ((features & JSONWriter.Feature.WriteNulls.mask) != 0) {
                writeFieldName(jsonWriter);
                jsonWriter.writeNull();
                return true;
            } else {
                return false;
            }
        }

        writeEnum(jsonWriter, value);
        return true;
    }
}

        try {
            return method.invoke(object);
        } catch (IllegalArgumentException | IllegalAccessException | InvocationTargetException e) {
            throw new JSONException("invoke getter method error, " + fieldName, e);
        }
    
<methods>public boolean write(com.alibaba.fastjson2.JSONWriter, java.lang.Object) ,public final void writeEnum(com.alibaba.fastjson2.JSONWriter, Enum#RAW) ,public final void writeEnumJSONB(com.alibaba.fastjson2.JSONWriter, Enum#RAW) ,public final void writeValue(com.alibaba.fastjson2.JSONWriter, java.lang.Object) <variables>final non-sealed Enum#RAW[] enumConstants,final non-sealed Class#RAW enumType,final non-sealed long[] hashCodes,final non-sealed long[] hashCodesSymbolCache,final non-sealed char[][] utf16ValueCache,final non-sealed byte[][] utf8ValueCache,final non-sealed char[][] valueNameCacheUTF16,final non-sealed byte[][] valueNameCacheUTF8