AttCrossSectionalShape.java 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. package com.miniframe.generate.appcode;
  2. /**
  3. * 横截面形状
  4. */
  5. public enum AttCrossSectionalShape {
  6. 圆形("圆形", "0", "圆形"),
  7. 正方形("正方形", "1", "正方形"),
  8. 矩形("矩形", "2", "矩形"),
  9. 六边形("六边形", "3", "六边形"),
  10. 圆环形("圆环形", "4", "圆环形");
  11. // 成员变量
  12. private String index; // value
  13. private String name; // key
  14. private String desc; // 描述
  15. /**
  16. * 构造方法
  17. * @param name
  18. * @param index
  19. * @param desc
  20. */
  21. private AttCrossSectionalShape(String name, String index, String desc) {
  22. this.name = name;
  23. this.index = index;
  24. this.desc = desc;
  25. }
  26. /**
  27. * 通过index获取对象
  28. *
  29. * @param index
  30. * @return
  31. */
  32. public static AttCrossSectionalShape getAttCrossSectionalShape(String index) {
  33. for (AttCrossSectionalShape c : AttCrossSectionalShape.values()) {
  34. if (c.getIndex().equals(index)) {
  35. return c;
  36. }
  37. }
  38. return null;
  39. }
  40. public String getName() {
  41. return name;
  42. }
  43. public void setName(String name) {
  44. this.name = name;
  45. }
  46. public String getIndex() {
  47. return index;
  48. }
  49. public void setIndex(String index) {
  50. this.index = index;
  51. }
  52. public String getDesc() {
  53. return desc;
  54. }
  55. public void setDesc(String desc) {
  56. this.desc = desc;
  57. }
  58. }