package com.aps.core.enums; public enum PLAN_TASK_STATUS { IN_PROCESS("InProgress","进行中"), FINISHED("Finished","完成"); private String code; private String desc; PLAN_TASK_STATUS(String code ,String desc){ this.code = code; this.desc=desc; } public static PLAN_TASK_TYPE getByCode(String code){ for(PLAN_TASK_TYPE type : PLAN_TASK_TYPE.values()){ if(type.getCode().equals(code)){ return type; } } return null; } public String getCode() { return code; } public void setCode(String code) { this.code = code; } public String getDesc() { return desc; } public void setDesc(String desc) { this.desc = desc; } }