package com.zy.core.enums; public enum CrnModeType { HAND(1), // 手动模式中 AUTO(2), // 半自动模式中 COMPUTER(3), // 电脑模式中 ; public Integer id; CrnModeType(Integer id) { this.id = id; } public static CrnModeType get(Short id) { if (null == id) { return null; } for (CrnModeType type : CrnModeType.values()) { if (type.id.equals(id.intValue())) { return type; } } return null; } public static CrnModeType get(CrnModeType type) { if (null == type) { return null; } for (CrnModeType crnModeType : CrnModeType.values()) { if (crnModeType == type) { return crnModeType; } } return null; } }