package com.zy.asrs.domain.enums; public enum NotifyMsgType { //任务 TASK_START("task_start", "任务开始"), TASK_COMPLETE("task_complete", "任务完成"), TASK_CANCEL("task_cancel", "任务取消"), ; public String flag; public String desc; NotifyMsgType(String flag, String desc) { this.flag = flag; this.desc = desc; } public static NotifyMsgType get(String flag) { if (null == flag) { return null; } for (NotifyMsgType type : NotifyMsgType.values()) { if (type.flag.equals(flag)) { return type; } } return null; } public static NotifyMsgType get(NotifyMsgType type) { if (null == type) { return null; } for (NotifyMsgType type2 : NotifyMsgType.values()) { if (type2 == type) { return type2; } } return null; } }