package com.zy.core.enums; /** * RGV模式枚举 */ public enum RgvModeType { STOP((short) 0, "停机模式"), MANUAL((short) 1, "手动模式"), AUTO((short) 2, "自动模式"), COMPUTER((short) 3, "电脑模式"), ; public Short id; public String desc; RgvModeType(Short id, String desc) { this.id = id; this.desc = desc; } public static RgvModeType get(Short id) { if (null == id) { return null; } for (RgvModeType type : RgvModeType.values()) { if (type.id.equals(id)) { return type; } } return null; } public static RgvModeType get(RgvModeType type) { if (null == type) { return null; } for (RgvModeType type1 : RgvModeType.values()) { if (type1 == type) { return type1; } } return null; } }