NoticeBusinessEnum.java 812 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package com.imed.costaccount.enums;
  2. import java.util.Objects;
  3. /**
  4. * 消息枚举
  5. */
  6. public enum NoticeBusinessEnum {
  7. CHECK_PLAN(1, "查核计划"),
  8. IMPROVE_TASK(2, "改善任务"),
  9. SITUATION_DETAIL(3, "情境详情"),
  10. ;
  11. private Integer key;
  12. private String value;
  13. NoticeBusinessEnum(Integer key, String value) {
  14. this.key = key;
  15. this.value = value;
  16. }
  17. public Integer getKey() {
  18. return key;
  19. }
  20. public String getValue() {
  21. return value;
  22. }
  23. public static String getByCode(Integer key) {
  24. for (NoticeBusinessEnum jobUserTypeEnum : NoticeBusinessEnum.values()) {
  25. if (Objects.equals(key, jobUserTypeEnum.key)) {
  26. return jobUserTypeEnum.value;
  27. }
  28. }
  29. return null;
  30. }
  31. }