package com.zy.core.enums; /** * 四向穿梭车 */ public enum ShuttleStatusType { IDLE(1, "空闲"), BUSY(0, "忙"), ; public Integer id; public String desc; ShuttleStatusType(Integer id,String desc) { this.id = id; this.desc = desc; } public static ShuttleStatusType get(Integer id) { if (null == id) { return null; } for (ShuttleStatusType type : ShuttleStatusType.values()) { if (type.id == id) { 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; } }