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