123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869 |
- package com.miniframe.generate.appcode;
- /**
- * 横截面形状
- */
- public enum AttCrossSectionalShape {
- 圆形("圆形", "0", "圆形"),
- 正方形("正方形", "1", "正方形"),
- 矩形("矩形", "2", "矩形"),
- 六边形("六边形", "3", "六边形"),
- 圆环形("圆环形", "4", "圆环形");
- // 成员变量
- private String index; // value
- private String name; // key
- private String desc; // 描述
-
- /**
- * 构造方法
- * @param name
- * @param index
- * @param desc
- */
- private AttCrossSectionalShape(String name, String index, String desc) {
- this.name = name;
- this.index = index;
- this.desc = desc;
- }
- /**
- * 通过index获取对象
- *
- * @param index
- * @return
- */
- public static AttCrossSectionalShape getAttCrossSectionalShape(String index) {
- for (AttCrossSectionalShape c : AttCrossSectionalShape.values()) {
- if (c.getIndex().equals(index)) {
- return c;
- }
- }
- return null;
- }
- public String getName() {
- return name;
- }
- public void setName(String name) {
- this.name = name;
- }
- public String getIndex() {
- return index;
- }
- public void setIndex(String index) {
- this.index = index;
- }
- public String getDesc() {
- return desc;
- }
- public void setDesc(String desc) {
- this.desc = desc;
- }
- }
|