标签:cts hash nis fill run pre public sync get
package com.erp.sign.pojo.constants;
import java.util.HashMap;
import java.util.Map;
/**
*
* 合同状态枚举
* @auther han
* @date 2021/1/19
*/
public enum MyContractStatus {
DRAFT("DRAFT","草稿"),
SIGNING("SIGNING","签署中"),
COMPLETE("COMPLETE","已完成"),
REJECTED("REJECTED","已退回"),
RECALLED("RECALLED","已撤回"),
EXPIRED("EXPIRED","已过期"),
FILLING("FILLING","拟定中"),
TERMINATING("TERMINATING","作废确认中"),
TERMINATED("TERMINATED","已作废"),
DELETE("DELETE","已删除"),
FINISHED("FINISHED","已完成"),
CANCELLED("CANCELLED","已作废");
private final String val;
private final String labCode;
private static Map<String, MyContractStatus> enumMap;
MyContractStatus(String val, String labCode) {
this.val = val;
this.labCode = labCode;
}
public String getVal() {
return val;
}
public String getLabel() {
return labCode;
}
public static MyContractStatus getInstByVal(String key) {
if (enumMap == null) {
synchronized (MyContractStatus.class) {
if (enumMap == null) {
enumMap = new HashMap<String, MyContractStatus>();
for (MyContractStatus perEnum : MyContractStatus.values()) {
enumMap.put(perEnum.getVal() + "", perEnum);
}
}
}
}
if (!enumMap.containsKey(key)) {
throw new RuntimeException("状态值" + key + "对应的MyContractStatus枚举值不存在。");
}
return enumMap.get(key);
}
}
标签:cts hash nis fill run pre public sync get
原文地址:https://www.cnblogs.com/hanzhengjie/p/14483842.html