提交 | 用户 | 时间
|
dc2e04
|
1 |
package com.iailab.module.data.enums; |
潘 |
2 |
|
|
3 |
import lombok.AllArgsConstructor; |
|
4 |
import lombok.Getter; |
|
5 |
|
|
6 |
/** |
9695d7
|
7 |
* 测点频率类型 |
dc2e04
|
8 |
*/ |
潘 |
9 |
@Getter |
|
10 |
@AllArgsConstructor |
e78121
|
11 |
public enum DataPointFreqEnum { |
潘 |
12 |
NET_10S("10s", 10), |
|
13 |
NET_30S("30s", 30), |
|
14 |
NET_1MIN("1min",60); |
dc2e04
|
15 |
|
潘 |
16 |
private String code; |
|
17 |
|
|
18 |
private Integer value; |
|
19 |
|
e78121
|
20 |
public static DataPointFreqEnum getEumByCode(String code) { |
dc2e04
|
21 |
if (code == null) { |
潘 |
22 |
return null; |
|
23 |
} |
|
24 |
|
e78121
|
25 |
for (DataPointFreqEnum statusEnum : DataPointFreqEnum.values()) { |
dc2e04
|
26 |
if (statusEnum.getCode().equals(code)) { |
潘 |
27 |
return statusEnum; |
|
28 |
} |
|
29 |
} |
|
30 |
return null; |
|
31 |
} |
|
32 |
} |