| 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 RgvModeType { |  |   |  |     NONE(-1, "离线","ffffff"), |  |     STOP(2, "维修","ffffff"), |  |     HAND(0, "手动","ffffff"), |  |     HALF_AUTO(3, "半自动","ffffff"), |  |     AUTO(1, "自动","ffffff"), |  |     OTHER(100, "其它","ffffff"), |  |     ; |  |   |  |     public Integer id; |  |     public String desc; |  |     public String color; |  |     RgvModeType(Integer id, String desc, String color) { |  |         this.id = id; |  |         this.desc = desc; |  |         this.color = color; |  |     } |  |   |  |     public static RgvModeType get(Short id) { |  |         if (null == id) { |  |             return OTHER; |  |         } |  |         for (RgvModeType type : RgvModeType.values()) { |  |             if (type.id.equals(id.intValue())) { |  |                 return type; |  |             } |  |         } |  |         return OTHER; |  |     } |  |   |  |     public static RgvModeType get(RgvModeType type) { |  |         if (null == type) { |  |             return OTHER; |  |         } |  |         for (RgvModeType rgvModeType : RgvModeType.values()) { |  |             if (rgvModeType == type) { |  |                 return rgvModeType; |  |             } |  |         } |  |         return OTHER; |  |     } |  | } | 
 |