PlanStatusEnum.java 779 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. package com.imed.costaccount.common.enums;
  2. import java.util.Objects;
  3. /**
  4. * 计划状态枚举
  5. */
  6. public enum PlanStatusEnum {
  7. NOT_START(1, "未开始"),
  8. START(2, "进行中"),
  9. END(3, "已结束"),
  10. ;
  11. private Integer key;
  12. private String value;
  13. PlanStatusEnum(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 (PlanStatusEnum jobUserTypeEnum : PlanStatusEnum.values()) {
  25. if (Objects.equals(key, jobUserTypeEnum.key)) {
  26. return jobUserTypeEnum.value;
  27. }
  28. }
  29. return null;
  30. }
  31. }