package com.zy.core.enums; public enum MapNodeType { DISABLE(-1, "禁用"), NORMAL_PATH(0, "货位"), START_POINT(1, "起点"), TARGET_POINT(2, "终点"), MAIN_PATH(3, "母轨"), CONVEYOR(4, "输送站点"), CHARGE(5, "充电桩"), CONVEYOR_CAR_GO(6, "小车可走输送站点"), CAR(66, "小车"), LIFT(67, "提升机"), LOCK(-999, "锁定节点"), ; public Integer id; public String desc; MapNodeType(Integer id, String desc) { this.id = id; this.desc = desc; } public static MapNodeType get(Short id) { if (null == id) { return null; } for (MapNodeType type : MapNodeType.values()) { if (type.id.equals(id.intValue())) { return type; } } return null; } public static MapNodeType get(MapNodeType type) { if (null == type) { return null; } for (MapNodeType type1 : MapNodeType.values()) { if (type1 == type) { return type1; } } return null; } }