|
@@ -0,0 +1,49 @@
|
|
|
+package com.diagbot.enums;
|
|
|
+
|
|
|
+import com.diagbot.core.KeyedNamed;
|
|
|
+import lombok.Setter;
|
|
|
+
|
|
|
+/**
|
|
|
+ * @Description: 是否有效
|
|
|
+ * @author: gaodm
|
|
|
+ * @time: 2018/9/13 17:11
|
|
|
+ */
|
|
|
+public enum IsValidTypeEnum implements KeyedNamed {
|
|
|
+ IVALID(0, "无效"),
|
|
|
+ NOT_VALID(1, "有效");
|
|
|
+
|
|
|
+ @Setter
|
|
|
+ private int key;
|
|
|
+
|
|
|
+ @Setter
|
|
|
+ private String name;
|
|
|
+
|
|
|
+ IsValidTypeEnum(int key, String name) {
|
|
|
+ this.key = key;
|
|
|
+ this.name = name;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static IsValidTypeEnum getEnum(int key) {
|
|
|
+ for (IsValidTypeEnum item : IsValidTypeEnum.values()) {
|
|
|
+ if (item.key == key) {
|
|
|
+ return item;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+
|
|
|
+ public static String getName(int key) {
|
|
|
+ IsValidTypeEnum item = getEnum(key);
|
|
|
+ return item != null ? item.name : null;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public int getKey() {
|
|
|
+ return key;
|
|
|
+ }
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public String getName() {
|
|
|
+ return name;
|
|
|
+ }
|
|
|
+}
|