Advertisement
Guest User

Untitled

a guest
Aug 24th, 2019
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. /**
  2. * 根据枚举Key获取相应的枚举对象
  3. *
  4. * @param key 枚举的key
  5. * @return 枚举对象
  6. */
  7. public static ConfigTypeEnum getEnum(Integer key) {
  8. ConfigTypeEnum resultEnum = null;
  9. ConfigTypeEnum[] enumAry = ConfigTypeEnum.values();
  10. for (ConfigTypeEnum mapEnum : enumAry) {
  11. if (key.compareTo(mapEnum.getId()) == 0) {
  12. resultEnum = mapEnum;
  13. break;
  14. }
  15. }
  16. return resultEnum;
  17. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement