package com.zy.core.enums; public enum JarModeType { NONE(-1, "离线"), STOP(0, "离线"), // HAND(1, "手动"), HALF_AUTO(1, "手动"), AUTO(2, "自动"), OTHER(3, "其他"), OTHER2(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; } }