|
@@ -1,33 +1,31 @@
|
|
|
package com.diagbot.enums;
|
|
|
|
|
|
import com.diagbot.core.KeyedNamed;
|
|
|
-
|
|
|
import lombok.Setter;
|
|
|
|
|
|
/**
|
|
|
- *
|
|
|
* @author wangfeng
|
|
|
* @Description: 数据来源
|
|
|
* @date 2019年4月4日 上午9:56:09
|
|
|
*/
|
|
|
-public enum DataSourcesEnums implements KeyedNamed{
|
|
|
+public enum DataSourcesEnums implements KeyedNamed {
|
|
|
|
|
|
- Leading(1, "前端"),
|
|
|
- After(2, "后端"),
|
|
|
- BigData(3,"大数据");
|
|
|
+ Leading(1, "前端"),
|
|
|
+ After(2, "后端"),
|
|
|
+ BigData(3, "大数据");
|
|
|
|
|
|
- @Setter
|
|
|
- private Integer key;
|
|
|
+ @Setter
|
|
|
+ private int key;
|
|
|
|
|
|
@Setter
|
|
|
private String name;
|
|
|
|
|
|
- DataSourcesEnums(Integer key, String name) {
|
|
|
+ DataSourcesEnums(int key, String name) {
|
|
|
this.key = key;
|
|
|
this.name = name;
|
|
|
}
|
|
|
|
|
|
- public static DataSourcesEnums getEnum(Integer key) {
|
|
|
+ public static DataSourcesEnums getEnum(int key) {
|
|
|
for (DataSourcesEnums item : DataSourcesEnums.values()) {
|
|
|
if (item.key == key) {
|
|
|
return item;
|
|
@@ -36,8 +34,8 @@ public enum DataSourcesEnums implements KeyedNamed{
|
|
|
return null;
|
|
|
}
|
|
|
|
|
|
- public static String getName(Integer key) {
|
|
|
- DataSourcesEnums item = getEnum(key);
|
|
|
+ public static String getName(int key) {
|
|
|
+ DataSourcesEnums item = getEnum(key);
|
|
|
return item != null ? item.name : null;
|
|
|
}
|
|
|
|