package com.zy.core.enums.DevpType; import com.zy.core.enums.CrnStatusType; public enum DevpWorkType { NONE(-1,"离线"), IDLE(0,"空闲"), BUSY(1,"忙碌"); public Integer id; public String desc; DevpWorkType(Integer id, String desc) { this.id = id; this.desc = desc; } public static DevpWorkType get(Short id) { if (null == id) { return null; } for (DevpWorkType type : DevpWorkType.values()) { if (type.id.equals(id.intValue())) { return type; } } return NONE; } public static DevpWorkType get(DevpWorkType type) { if (null == type) { return null; } for (DevpWorkType devpWorkType : DevpWorkType.values()) { if (devpWorkType == type) { return devpWorkType; } } return null; } }