| 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
 | | package com.zy.core.enums; |  |   |  | /** |  |  * 四向穿梭车 |  |  */ |  | public enum ShuttleStatusType { |  |   |  |     IDLE(1, "空闲"), |  |     BUSY(0, "忙"), |  |     ; |  |   |  |     public Integer id; |  |     public String desc; |  |   |  |     ShuttleStatusType(Integer id,String desc) { |  |         this.id = id; |  |         this.desc = desc; |  |     } |  |   |  |     public static ShuttleStatusType get(Integer id) { |  |         if (null == id) { |  |             return null; |  |         } |  |         for (ShuttleStatusType type : ShuttleStatusType.values()) { |  |             if (type.id == id) { |  |                 return type; |  |             } |  |         } |  |         return BUSY; |  |     } |  |   |  |     public static ShuttleStatusType get(ShuttleStatusType type) { |  |         if (null == type) { |  |             return null; |  |         } |  |         for (ShuttleStatusType shuttleStatusType : ShuttleStatusType.values()) { |  |             if (shuttleStatusType == type) { |  |                 return shuttleStatusType; |  |             } |  |         } |  |         return null; |  |     } |  |   |  | } | 
 |