package com.zy.core.enums; public enum LiftDeviceStatusType { NONE(-1, "离线"), IDLE(0, "空闲"), BUSY(1, "忙碌"), WAITING(98, "等待确认"), ERROR(99, "故障"), ; public Integer id; public String desc; LiftDeviceStatusType(Integer id, String desc) { this.id = id; this.desc = desc; } public static LiftDeviceStatusType get(Integer id) { if (null == id) { return NONE; } for (LiftDeviceStatusType type : LiftDeviceStatusType.values()) { if (type.id.equals(id)) { return type; } } return NONE; } public static LiftDeviceStatusType get(LiftDeviceStatusType type) { if (null == type) { return NONE; } for (LiftDeviceStatusType type2 : LiftDeviceStatusType.values()) { if (type2 == type) { return type2; } } return NONE; } }