package com.zy.common.model.enums; import java.util.ArrayList; import java.util.List; public enum NavigationMapType { NONE(-1, "无过滤"), DFX(1, "地图携带库位状态DFX"), NORMAL(2, "地图携带库位状态X"), SHUTTLE(3, "地图携带小车"), LIFT(4, "地图携带提升机"), PATH_LOCK(5, "路径锁"), TRAFFIC_CONTROL(6, "交通管制"), ; public Integer id; public String desc; NavigationMapType(Integer id, String desc) { this.id = id; this.desc = desc; } public static NavigationMapType get(Short id) { if (null == id) { return null; } for (NavigationMapType type : NavigationMapType.values()) { if (type.id.equals(id.intValue())) { return type; } } return null; } public static NavigationMapType get(NavigationMapType type) { if (null == type) { return null; } for (NavigationMapType type1 : NavigationMapType.values()) { if (type1 == type) { return type1; } } return null; } public static List getDfxWithDevice() { return getMapTypes(DFX, SHUTTLE, LIFT); } public static List getNormalWithDevice() { return getMapTypes(NORMAL, SHUTTLE, LIFT); } public static List getMapTypes(NavigationMapType... types) { List mapTypes = new ArrayList<>(); for (NavigationMapType type : types) { mapTypes.add(type); } return mapTypes; } }