package com.zy.core.enums; /** * 四向穿梭车内部状态枚举 */ public enum ShuttleProtocolStatusType { IDLE(1, "空闲"), WORKING(2, "作业中"), WAITING(3, "等待确认"), CHARGING(4, "充电中"), CHARGING_WAITING(5, "充电任务等待确认"), FIXING(6, "故障修复中"), OFFLINE(7, "离线"), ; public Integer id; public String desc; ShuttleProtocolStatusType(Integer id, String desc) { this.id = id; this.desc = desc; } public static ShuttleProtocolStatusType get(Integer id) { if (null == id) { return null; } for (ShuttleProtocolStatusType type : ShuttleProtocolStatusType.values()) { if (type.id.equals(id.intValue())) { return type; } } return null; } public static ShuttleProtocolStatusType get(ShuttleProtocolStatusType type) { if (null == type) { return null; } for (ShuttleProtocolStatusType type2 : ShuttleProtocolStatusType.values()) { if (type2 == type) { return type2; } } return null; } }