|
@@ -0,0 +1,51 @@
|
|
|
+package com.diagbot.enums;
|
|
|
+
|
|
|
+import com.diagbot.core.KeyedNamed;
|
|
|
+import lombok.Setter;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @Description: 不良反应控件类型
|
|
|
+ * @Author:zhaops
|
|
|
+ * @time: 2019/3/14 11:16
|
|
|
+ */
|
|
|
+public enum GBControlTypeEnum implements KeyedNamed {
|
|
|
+ Radio(0, "单选"),
|
|
|
+ CheckBox(1, "多选"),
|
|
|
+ Text(2,"文本"),
|
|
|
+ Dropdownlist(3,"下拉列表");
|
|
|
+
|
|
|
+ @Setter
|
|
|
+ private Integer key;
|
|
|
+
|
|
|
+ @Setter
|
|
|
+ private String name;
|
|
|
+
|
|
|
+ GBControlTypeEnum(Integer key, String name) {
|
|
|
+ this.key = key;
|
|
|
+ this.name = name;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static GBControlTypeEnum getEnum(Integer key) {
|
|
|
+ for (GBControlTypeEnum item : GBControlTypeEnum.values()) {
|
|
|
+ if (item.key == key) {
|
|
|
+ return item;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static String getName(Integer key) {
|
|
|
+ GBControlTypeEnum item = getEnum(key);
|
|
|
+ return item != null ? item.name : null;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int getKey() {
|
|
|
+ return key;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public String getName() {
|
|
|
+ return name;
|
|
|
+ }
|
|
|
+}
|