dongyukun
2024-11-05 e8ad669f7c97d45cd23630dc101180a130d6c17e
提交 | 用户 | 时间
ce910c 1 package com.netsdk.lib.enumeration;
H 2
3
4 /** 
5 * @author 291189
6 * @description  雷达检测车型 
7 * @date 2022/06/07 09:46:01
8 */
9 public enum EM_RADAR_DETECTION_VEHICLE_TYPE {
10 /**
11 未知
12 */
13 EM_RADAR_DETECTION_VEHICLE_TYPE_UNKNOWN(0,"未知"),
14 /**
15 中小客车
16 */
17 EM_RADAR_DETECTION_VEHICLE_TYPE_MID_PASSENGER_CAR(1,"中小客车"),
18 /**
19 大客车
20 */
21 EM_RADAR_DETECTION_VEHICLE_TYPE_MOTOR_BUS(2,"大客车"),
22 /**
23 小货车
24 */
25 EM_RADAR_DETECTION_VEHICLE_TYPE_MICRO_TRUCK(3,"小货车"),
26 /**
27 中型货车
28 */
29 EM_RADAR_DETECTION_VEHICLE_TYPE_MID_TRUCK(4,"中型货车"),
30 /**
31 大型货车
32 */
33 EM_RADAR_DETECTION_VEHICLE_TYPE_LARGE_TRUCK(5,"大型货车"),
34 /**
35 特大货车
36 */
37 EM_RADAR_DETECTION_VEHICLE_TYPE_SUPER_TRUCK(6,"特大货车"),
38 /**
39 集装箱车
40 */
41 EM_RADAR_DETECTION_VEHICLE_TYPE_CONTAINER_CAR(7,"集装箱车"),
42 /**
43 摩托车
44 */
45 EM_RADAR_DETECTION_VEHICLE_TYPE_MOTORCYCLE(8,"摩托车"),
46 /**
47 拖拉机
48 */
49 EM_RADAR_DETECTION_VEHICLE_TYPE_TRACTOR(9,"拖拉机");
50
51 private int value;
52
53 private String note;
54
55 public String getNote() {
56         return note;
57     }
58
59 public int getValue() {
60         return value;
61     }
62
63 EM_RADAR_DETECTION_VEHICLE_TYPE(int givenValue, String note) {
64         this.value = givenValue;
65         this.note = note;
66     }
67
68 public static String getNoteByValue(int givenValue) {
69         for (EM_RADAR_DETECTION_VEHICLE_TYPE enumType : EM_RADAR_DETECTION_VEHICLE_TYPE.values()) {
70             if (givenValue == enumType.getValue()) {
71                 return enumType.getNote();
72             }
73         }
74         return null;
75     }
76
77 public static int getValueByNote(String givenNote) {
78         for (EM_RADAR_DETECTION_VEHICLE_TYPE enumType : EM_RADAR_DETECTION_VEHICLE_TYPE.values()) {
79             if (givenNote.equals(enumType.getNote())) {
80                 return enumType.getValue();
81             }
82         }
83         return -1;
84     }
85
86 public static EM_RADAR_DETECTION_VEHICLE_TYPE getEnum(int value) {
87         for (EM_RADAR_DETECTION_VEHICLE_TYPE e : EM_RADAR_DETECTION_VEHICLE_TYPE.values()) {
88             if (e.getValue() == value)
89                 return e;
90         }
91         return EM_RADAR_DETECTION_VEHICLE_TYPE.EM_RADAR_DETECTION_VEHICLE_TYPE_UNKNOWN;
92     }
93
94 }