YunkaiDifficulty.java 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. package cn.com.qmth.export;
  2. public enum YunkaiDifficulty {
  3. RONGYI(1,"容易",1.0,"易"),
  4. JIAORONGYI(2,"较容易",0.7,"易"),
  5. ZHONGDENG(3,"中等",0.5,"中"),
  6. JIAONAN(4,"较难",0.3,"难"),
  7. KUNNAN(5,"困难",0.1,"难"),
  8. ;
  9. private Integer yunKaiType;
  10. private String yunKaiDesc;
  11. private Double type;
  12. private String desc;
  13. private YunkaiDifficulty(Integer yunKaiType, String yunKaiDesc, Double type, String desc) {
  14. this.yunKaiType = yunKaiType;
  15. this.yunKaiDesc = yunKaiDesc;
  16. this.type = type;
  17. this.desc = desc;
  18. }
  19. public Integer getYunKaiType() {
  20. return yunKaiType;
  21. }
  22. public void setYunKaiType(Integer yunKaiType) {
  23. this.yunKaiType = yunKaiType;
  24. }
  25. public String getYunKaiDesc() {
  26. return yunKaiDesc;
  27. }
  28. public void setYunKaiDesc(String yunKaiDesc) {
  29. this.yunKaiDesc = yunKaiDesc;
  30. }
  31. public Double getType() {
  32. return type;
  33. }
  34. public void setType(Double type) {
  35. this.type = type;
  36. }
  37. public String getDesc() {
  38. return desc;
  39. }
  40. public void setDesc(String desc) {
  41. this.desc = desc;
  42. }
  43. public static YunkaiDifficulty getByYunKaiType(Integer yunKaiType) {
  44. if(yunKaiType==null) {
  45. return null;
  46. }
  47. for(YunkaiDifficulty t:YunkaiDifficulty.values()) {
  48. if(t.getYunKaiType().equals(yunKaiType)) {
  49. return t;
  50. }
  51. }
  52. return null;
  53. }
  54. }