package com.zy.core.enums; /** * 四向穿梭车 * Wm200 小车忙状态位 */ public enum ShuttleStatusType { IDLE((short)0, "空闲"), BUSY((short)1, "忙"), ; public Short id; public String desc; ShuttleStatusType(Short id,String desc) { this.id = id; this.desc = desc; } public static ShuttleStatusType get(Short id) { if (null == id) { return null; } for (ShuttleStatusType type : ShuttleStatusType.values()) { if (type.id.equals(id.shortValue())) { return type; } } return BUSY; } public static ShuttleStatusType get(ShuttleStatusType type) { if (null == type) { return null; } for (ShuttleStatusType shuttleStatusType : ShuttleStatusType.values()) { if (shuttleStatusType == type) { return shuttleStatusType; } } return null; } }