houzhongjian
2024-10-30 a28ca3f36d0ace05966a8c0fac1e4b5fe921f882
提交 | 用户 | 时间
ce910c 1 package com.netsdk.lib.enumeration;
H 2
3 /**
4  * @author 251823
5  * @description 智能交通雷达检测汽车状态
6  * @date 2020/12/14
7  */
8 public enum EM_TRAFFIC_SNAP_RADAR_DETECT_CAR_STATE {
9     // 未知
10     EM_TRAFFIC_SNAP_RADAR_DETECT_CAR_STATE_UNKNOWN(-1, "未知"),
11     // 无车
12     EM_TRAFFIC_SNAP_RADAR_DETECT_CAR_STATE_NO_CAR(0, "无车"),
13     // 有车
14     EM_TRAFFIC_SNAP_RADAR_DETECT_CAR_STATE_CAR(1, "有车");
15
16     private int value;
17     private String note;
18
19     private EM_TRAFFIC_SNAP_RADAR_DETECT_CAR_STATE(int givenValue, String note) {
20         this.value = givenValue;
21         this.note = note;
22     }
23
24     public String getNote() {
25         return note;
26     }
27
28     public int getValue() {
29         return value;
30     }
31
32     public static String getNoteByValue(int givenValue) {
33         for (EM_TRAFFIC_SNAP_RADAR_DETECT_CAR_STATE enumType : EM_TRAFFIC_SNAP_RADAR_DETECT_CAR_STATE.values()) {
34             if (givenValue == enumType.getValue()) {
35                 return enumType.getNote();
36             }
37         }
38         return null;
39     }
40
41     public static int getValueByNote(String givenNote) {
42         for (EM_TRAFFIC_SNAP_RADAR_DETECT_CAR_STATE enumType : EM_TRAFFIC_SNAP_RADAR_DETECT_CAR_STATE.values()) {
43             if (givenNote.equals(enumType.getNote())) {
44                 return enumType.getValue();
45             }
46         }
47         return -2;
48     }
49
50 }