| 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
 | | package com.zy.core.enums; |  |   |  | public enum CrnModeType { |  |   |  |     NONE(0, "未选择"), |  |     AUTO(1, "自动"), |  |     HALF_AUTO(2, "半自动"), |  |     HAND(3, "手动"), |  |     STOP(4, "维修"), |  |     ; |  |   |  |     public Integer id; |  |     public String desc; |  |     CrnModeType(Integer id, String desc) { |  |         this.id = id; |  |         this.desc = desc; |  |     } |  |   |  |     public static CrnModeType get(Short id) { |  |         if (null == id) { |  |             return null; |  |         } |  |         for (CrnModeType type : CrnModeType.values()) { |  |             if (type.id.equals(id.intValue())) { |  |                 return type; |  |             } |  |         } |  |         return null; |  |     } |  |   |  |     public static CrnModeType get(CrnModeType type) { |  |         if (null == type) { |  |             return null; |  |         } |  |         for (CrnModeType crnModeType : CrnModeType.values()) { |  |             if (crnModeType == type) { |  |                 return crnModeType; |  |             } |  |         } |  |         return null; |  |     } |  | } | 
 |