提交 | 用户 | 时间
|
a6de49
|
1 |
package com.iailab.module.data.point.common; |
H |
2 |
|
01d6f8
|
3 |
import lombok.AllArgsConstructor; |
潘 |
4 |
import lombok.Getter; |
|
5 |
|
a6de49
|
6 |
/** |
H |
7 |
* @author PanZhibao |
|
8 |
* @date 2021年04月25日 11:41 |
|
9 |
*/ |
01d6f8
|
10 |
@Getter |
潘 |
11 |
@AllArgsConstructor |
a6de49
|
12 |
public enum PointTypeEnum { |
01d6f8
|
13 |
MEASURE_POINT("MEASURE", "测量点"), |
潘 |
14 |
CALCULATE_POINT("CALCULATE", "计算点"), |
0ed8ac
|
15 |
CONSTANT("CONSTANT", "常量点"), |
潘 |
16 |
CUMULATE("CUMULATE", "累计点"); |
a6de49
|
17 |
|
H |
18 |
private String code; |
|
19 |
|
01d6f8
|
20 |
private String desc; |
a6de49
|
21 |
|
01d6f8
|
22 |
public static PointTypeEnum getEumByCode(String code) { |
潘 |
23 |
if (code == null) { |
|
24 |
return null; |
|
25 |
} |
a6de49
|
26 |
|
01d6f8
|
27 |
for (PointTypeEnum statusEnum : PointTypeEnum.values()) { |
潘 |
28 |
if (statusEnum.getCode().equals(code)) { |
|
29 |
return statusEnum; |
|
30 |
} |
|
31 |
} |
|
32 |
return null; |
a6de49
|
33 |
} |
H |
34 |
} |