提交 | 用户 | 时间
|
149dd0
|
1 |
package com.iailab.module.data.video.enums; |
H |
2 |
|
|
3 |
import lombok.AllArgsConstructor; |
|
4 |
import lombok.Getter; |
|
5 |
|
|
6 |
/** |
|
7 |
* @author PanZhibao |
|
8 |
* @Description |
|
9 |
* @createTime 2024年03月12日 |
|
10 |
*/ |
|
11 |
@Getter |
|
12 |
@AllArgsConstructor |
|
13 |
public enum AlarmStatusEnum { |
|
14 |
|
|
15 |
NORMAL(0,"无排放"), |
|
16 |
POLLUTION(1,"有排放"), |
|
17 |
EXCEPTION(2,"设备异常"); |
|
18 |
|
|
19 |
private Integer code; |
|
20 |
private String desc; |
|
21 |
|
|
22 |
public static AlarmStatusEnum getEumByCode(Integer code){ |
|
23 |
if(code == null) {return null;} |
|
24 |
|
|
25 |
for(AlarmStatusEnum statusEnum: AlarmStatusEnum.values()) { |
|
26 |
if(statusEnum.getCode().equals(code)) { |
|
27 |
return statusEnum; |
|
28 |
} |
|
29 |
} |
|
30 |
return null; |
|
31 |
} |
|
32 |
} |