package com.zy.core.enums; public enum JarModeType { NONE(-1, "离线"), STOP(0, "维修"), HAND(1, "手动"), HALF_AUTO(2, "半自动"), AUTO(3, "自动"), AUTO2(100, "其它"), ; public Integer id; public String desc; JarModeType(Integer id, String desc) { this.id = id; this.desc = desc; } public static JarModeType get(Integer id) { if (null == id) { return null; } for (JarModeType type : JarModeType.values()) { if (type.id.equals(id)) { return type; } } return null; } public static JarModeType get(JarModeType type) { if (null == type) { return null; } for (JarModeType jarModeType : JarModeType.values()) { if (jarModeType == type) { return jarModeType; } } return null; } }