Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * 根据枚举Key获取相应的枚举对象
- *
- * @param key 枚举的key
- * @return 枚举对象
- */
- public static ConfigTypeEnum getEnum(Integer key) {
- ConfigTypeEnum resultEnum = null;
- ConfigTypeEnum[] enumAry = ConfigTypeEnum.values();
- for (ConfigTypeEnum mapEnum : enumAry) {
- if (key.compareTo(mapEnum.getId()) == 0) {
- resultEnum = mapEnum;
- break;
- }
- }
- return resultEnum;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement