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 SteStatusType { 
 |    
 |      IDLE(0, "空闲"), 
 |      MOVING(1, "作业中"), 
 |      SOS(2, "报警"), 
 |      WAITING(10, "等待确认"), 
 |      OFF_LINE(-1, "未知"), 
 |      ; 
 |    
 |      public Integer id; 
 |      public String desc; 
 |      SteStatusType(Integer id, String desc) { 
 |          this.id = id; 
 |          this.desc = desc; 
 |      } 
 |    
 |      public static SteStatusType get(Short id) { 
 |          if (null == id) { 
 |              return null; 
 |          } 
 |          for (SteStatusType type : SteStatusType.values()) { 
 |              if (type.id.equals(id.intValue())) { 
 |                  return type; 
 |              } 
 |          } 
 |          return OFF_LINE; 
 |      } 
 |    
 |      public static SteStatusType get(SteStatusType type) { 
 |          if (null == type) { 
 |              return null; 
 |          } 
 |          for (SteStatusType crnStatusType : SteStatusType.values()) { 
 |              if (crnStatusType == type) { 
 |                  return crnStatusType; 
 |              } 
 |          } 
 |          return null; 
 |      } 
 |  } 
 |  
  |