提交 | 用户 | 时间
|
b425df
|
1 |
package com.iailab.module.model.common.enums; |
潘 |
2 |
|
|
3 |
import lombok.AllArgsConstructor; |
|
4 |
import lombok.Getter; |
|
5 |
|
|
6 |
/** |
|
7 |
* @author PanZhibao |
|
8 |
* @Description |
|
9 |
* @createTime 2024年05月12日 |
|
10 |
*/ |
|
11 |
@Getter |
|
12 |
@AllArgsConstructor |
|
13 |
public enum DataSourceType { |
|
14 |
OPCUA("OPCUA", "OPC UA"), |
|
15 |
OPCDA("OPCDA", "OPC DA"), |
|
16 |
ModBus("ModBus", "ModBus"), |
|
17 |
KIO("KIO", "KIO"), |
|
18 |
HTTP("HTTP", "HTTP"); |
|
19 |
|
|
20 |
private String code; |
|
21 |
private String desc; |
|
22 |
|
|
23 |
public static DataSourceType getEumByCode(String code) { |
|
24 |
if (code == null) { |
|
25 |
return null; |
|
26 |
} |
|
27 |
|
|
28 |
for (DataSourceType statusEnum : DataSourceType.values()) { |
|
29 |
if (statusEnum.getCode().equals(code)) { |
|
30 |
return statusEnum; |
|
31 |
} |
|
32 |
} |
|
33 |
return null; |
|
34 |
} |
|
35 |
} |