package com.zy.core.enums; public enum SteStatusType { OFF_LINE(-1, "未知"), IDLE(0, "空闲"), MOVING(1, "作业中"), SOS(2, "停止中"), SOS2(3, "报警:故障中"), SOS3(4, "复位中"), CHARGE(5, "充电中"), WAITING(10, "等待确认"), WAITING2(11, "有物待作业"), OTHER(100, "其它"), ; public Integer id; public String desc; SteStatusType(Integer id, String desc) { this.id = id; this.desc = desc; } public static SteStatusType get(Short id) { if (null == id) { return null; } for (SteStatusType type : SteStatusType.values()) { if (type.id.equals(id.intValue())) { return type; } } return OFF_LINE; } public static SteStatusType get(SteStatusType type) { if (null == type) { return null; } for (SteStatusType crnStatusType : SteStatusType.values()) { if (crnStatusType == type) { return crnStatusType; } } return null; } }