springboot枚举简单使用笔记
定义枚举:
package com.geofly.ynygzx.iscp.api.common.enums;
/**
* @Description: 需求提交记录状态枚举
*
* @Param:
* @Return:
* @Author yanghaoxing
* @Date 2024/7/12 10:01
*/
public enum RequirementSubmissionStatus {
BACK("已撤回", 0),
SUBMIT("已提交", 1),
SUCCESS("已完成", 2);
private final String name;
private final int value;
RequirementSubmissionStatus(String name, int value) {
this.name = name;
this.value = value;
}
public String getName() {
return name;
}
public int getValue() {
return value;
}
}
使用: