fourcal/src/main/java/cn/palmte/work/bean/CertaintyEnum.java

49 lines
1.2 KiB
Java
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package cn.palmte.work.bean;
/**
* @author xiongshiyan at 2021/11/1 , contact me with email yanshixiong@126.com or phone 15208384257
*/
public enum CertaintyEnum {
PLAN_O(-1,""),
PLAN_A(1,"A项目成功率80%-100%"),
PLAN_B(2,"B项目成功率60%-80%"),
PLAN_C(3,"C项目成功率40%-60%");
private int certainty;
private String certaintyStr;
private CertaintyEnum(int certainty, String certaintyStr) {
this.certainty = certainty;
this.certaintyStr = certaintyStr;
}
public int getCertainty() {
return certainty;
}
public void setCertainty(int certainty) {
this.certainty = certainty;
}
public String getCertaintyStr() {
return certaintyStr;
}
public void setCertaintyStr(String certaintyStr) {
this.certaintyStr = certaintyStr;
}
public static CertaintyEnum parseCertainty(int certainty){
if(certainty == 1){
return PLAN_A;
}
if(certainty == 2){
return PLAN_B;
}
if(certainty == 3){
return PLAN_C;
}
throw new IllegalArgumentException("Unkown certainty:"+certainty);
}
}