dengzedong
2024-12-19 85b2001c0ec2f1adc598db3bf47ad457dcca7074
提交 | 用户 | 时间
149dd0 1 package com.iailab.netsdk.lib.enumeration;
H 2
3 /**
4  * 探测物体的传感器类型
5  *
6  * @author : 47040
7  * @since : Created in 2020/12/17 13:45
8  */
9 public enum EM_DETECT_SENSOR_TYPE {
10     /**
11      * 未知
12      */
13     EM_DETECT_SENSOR_TYPE_UNKNOWN(0, "未知"),
14     /**
15      * 线圈
16      */
17     EM_DETECT_SENSOR_TYPE_COIL(1, "线圈"),
18     /**
19      * 视频
20      */
21     EM_DETECT_SENSOR_TYPE_VIDEO(2, "视频"),
22     /**
23      * 雷达
24      */
25     EM_DETECT_SENSOR_TYPE_RADAR(3, "雷达"),
26     /**
27      * 5G
28      */
29     EM_DETECT_SENSOR_TYPE_5G(4, "5G"),
30     /**
31      * 融合
32      */
33     EM_DETECT_SENSOR_TYPE_FUSION(5, "融合");
34
35     private final int value;
36     private final String note;
37
38     EM_DETECT_SENSOR_TYPE(int givenValue, String note) {
39         this.value = givenValue;
40         this.note = note;
41     }
42
43     public String getNote() {
44         return note;
45     }
46
47     public int getValue() {
48         return value;
49     }
50
51     public static String getNoteByValue(int givenValue) {
52         for (EM_DETECT_SENSOR_TYPE enumType : EM_DETECT_SENSOR_TYPE.values()) {
53             if (givenValue == enumType.getValue()) {
54                 return enumType.getNote();
55             }
56         }
57         return null;
58     }
59
60     public static int getValueByNote(String givenNote) {
61         for (EM_DETECT_SENSOR_TYPE enumType : EM_DETECT_SENSOR_TYPE.values()) {
62             if (givenNote.equals(enumType.getNote())) {
63                 return enumType.getValue();
64             }
65         }
66         return -1;
67     }
68
69     public static EM_DETECT_SENSOR_TYPE getEnum(int value) {
70         for (EM_DETECT_SENSOR_TYPE e : EM_DETECT_SENSOR_TYPE.values()) {
71             if (e.getValue() == value)
72                 return e;
73         }
74         return EM_DETECT_SENSOR_TYPE.EM_DETECT_SENSOR_TYPE_UNKNOWN;
75     }
76 }