refundState.java 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. package com.goafanti.order.enums;
  2. import java.util.HashMap;
  3. import java.util.Map;
  4. public enum refundState {
  5. /** 正常 **/
  6. DSH(0,"待审核"),
  7. /** 废除 **/
  8. SHTG(1,"审核通过"),
  9. /** 锁定 **/
  10. SHJJ(2,"审核拒绝"),
  11. /** 无效 **/
  12. INVALID(10, "INVALID");
  13. private refundState(Integer code, String desc) {
  14. this.code = code;
  15. this.desc = desc;
  16. }
  17. private static Map<Integer, refundState> status = new HashMap<Integer, refundState>();
  18. static {
  19. for (refundState value : refundState.values()) {
  20. status.put(value.getCode(), value);
  21. }
  22. }
  23. public static refundState getStatus(Integer code) {
  24. if (containsType(code)) {
  25. return status.get(code);
  26. }
  27. return INVALID;
  28. }
  29. public static boolean containsType(Integer code) {
  30. return status.containsKey(code);
  31. }
  32. private Integer code;
  33. private String desc;
  34. public Integer getCode() {
  35. return code;
  36. }
  37. public void setCode(Integer code) {
  38. this.code = code;
  39. }
  40. public String getDesc() {
  41. return desc;
  42. }
  43. public void setDesc(String desc) {
  44. this.desc = desc;
  45. }
  46. }