| 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
44
45
 | | package com.zy.core.enums; |  |   |  | /** |  |  * 指令类型枚举 |  |  */ |  | public enum CommandStatusType { |  |   |  |     CREATE(1, "指令创建"),   //创建 |  |     EXECUTE(2, "指令执行中"),   //执行 |  |     COMPLETE(3, "指令完成"),  //完成 |  |     ; |  |   |  |     public Integer id; |  |     public String desc; |  |   |  |     CommandStatusType(Integer id, String desc) { |  |         this.id = id; |  |         this.desc = desc; |  |     } |  |   |  |     public static CommandStatusType get(Integer id) { |  |         if (null == id) { |  |             return null; |  |         } |  |         for (CommandStatusType type : CommandStatusType.values()) { |  |             if (type.id.equals(id)) { |  |                 return type; |  |             } |  |         } |  |         return null; |  |     } |  |   |  |     public static CommandStatusType get(CommandStatusType type) { |  |         if (null == type) { |  |             return null; |  |         } |  |         for (CommandStatusType type1 : CommandStatusType.values()) { |  |             if (type1 == type) { |  |                 return type1; |  |             } |  |         } |  |         return null; |  |     } |  |   |  | } | 
 |