1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
| package com.zy.core.enums;
|
| public enum LiftProtocolStatusType {
|
| NONE(-1, "未知"),
| IDLE(1, "空闲"),
| WORKING(2, "作业中"),
| WAITING(3, "等待确认"),
| OFFLINE(4, "离线"),
| ;
|
| public Integer id;
| public String desc;
|
| LiftProtocolStatusType(Integer id, String desc) {
| this.id = id;
| this.desc = desc;
| }
|
| public static LiftProtocolStatusType get(Integer id) {
| if (null == id) {
| return null;
| }
| for (LiftProtocolStatusType type : LiftProtocolStatusType.values()) {
| if (type.id.equals(id.intValue())) {
| return type;
| }
| }
| return null;
| }
|
| public static LiftProtocolStatusType get(LiftProtocolStatusType type) {
| if (null == type) {
| return null;
| }
| for (LiftProtocolStatusType type2 : LiftProtocolStatusType.values()) {
| if (type2 == type) {
| return type2;
| }
| }
| return null;
| }
| }
|
|