package com.zy.core.enums; public enum LiftProtocolStatusType { IDLE(1, "空闲"), WORKING(2, "作业中"), WAITING(3, "等待确认"), OFFLINE(4, "离线"), ; 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 null; } for (LiftProtocolStatusType type : LiftProtocolStatusType.values()) { if (type.id.equals(id.intValue())) { return type; } } return null; } public static LiftProtocolStatusType get(LiftProtocolStatusType type) { if (null == type) { return null; } for (LiftProtocolStatusType type2 : LiftProtocolStatusType.values()) { if (type2 == type) { return type2; } } return null; } }