潘志宝
2024-11-28 231897591c909b164defebfdb5936387ec2807d0
提交 | 用户 | 时间
149dd0 1 package com.iailab.netsdk.lib.enumeration;
H 2 /**
3  * @author : 291189
4  * @since : Created in 2021/6/30 10:28
5  *  报警位置
6  */
7 public enum EM_SECURITYGATE_ALARM_POSITION {
8     EM_SECURITYGATE_ALARM_POSITION_UNKNWON(-1,"未知"),        // 未知
9     EM_SECURITYGATE_ALARM_POSITION_LEFT_1(0,"左1"),                   // 左1
10     EM_SECURITYGATE_ALARM_POSITION_LEFT_2(1,"左2"),                   // 左2
11     EM_SECURITYGATE_ALARM_POSITION_LEFT_3(2,"左3"),                   // 左3
12     EM_SECURITYGATE_ALARM_POSITION_LEFT_4(3,"左4"),                   // 左4
13     EM_SECURITYGATE_ALARM_POSITION_LEFT_5(4,"左5"),                   // 左5
14     EM_SECURITYGATE_ALARM_POSITION_LEFT_6(5,"左6"),                   // 左6
15     EM_SECURITYGATE_ALARM_POSITION_MIDDLE_1(6,"中1"),                 // 中1
16     EM_SECURITYGATE_ALARM_POSITION_MIDDLE_2(7,"中2"),                 // 中2
17     EM_SECURITYGATE_ALARM_POSITION_MIDDLE_3(8,"中3"),                 // 中3
18     EM_SECURITYGATE_ALARM_POSITION_MIDDLE_4(9,"中4"),                 // 中4
19     EM_SECURITYGATE_ALARM_POSITION_MIDDLE_5(10,"中5"),                 // 中5
20     EM_SECURITYGATE_ALARM_POSITION_MIDDLE_6(11,"中6"),                 // 中6
21     EM_SECURITYGATE_ALARM_POSITION_RIGHT_1(12,"右1"),                  // 右1
22     EM_SECURITYGATE_ALARM_POSITION_RIGHT_2(13,"右2"),                  // 右2
23     EM_SECURITYGATE_ALARM_POSITION_RIGHT_3(14,"右3"),                  // 右3
24     EM_SECURITYGATE_ALARM_POSITION_RIGHT_4(15,"右4"),                  // 右4
25     EM_SECURITYGATE_ALARM_POSITION_RIGHT_5(16,"右5"),                  // 右5
26     EM_SECURITYGATE_ALARM_POSITION_RIGHT_6(17,"右6");                  // 右6
27
28     private final int value;
29     private final String note;
30
31     EM_SECURITYGATE_ALARM_POSITION(int givenValue, String note) {
32         this.value = givenValue;
33         this.note = note;
34     }
35
36     public String getNote() {
37         return note;
38     }
39
40     public int getValue() {
41         return value;
42     }
43
44     public static String getNoteByValue(int givenValue) {
45         for (EM_SECURITYGATE_ALARM_POSITION enumType : EM_SECURITYGATE_ALARM_POSITION.values()) {
46             if (givenValue == enumType.getValue()) {
47                 return enumType.getNote();
48             }
49         }
50         return null;
51     }
52
53     public static int getValueByNote(String givenNote) {
54         for (EM_SECURITYGATE_ALARM_POSITION enumType : EM_SECURITYGATE_ALARM_POSITION.values()) {
55             if (givenNote.equals(enumType.getNote())) {
56                 return enumType.getValue();
57             }
58         }
59         return -1;
60     }
61
62     public static EM_SECURITYGATE_ALARM_POSITION getEnum(int value) {
63         for (EM_SECURITYGATE_ALARM_POSITION e : EM_SECURITYGATE_ALARM_POSITION.values()) {
64             if (e.getValue() == value)
65                 return e;
66         }
67         return EM_SECURITYGATE_ALARM_POSITION.EM_SECURITYGATE_ALARM_POSITION_UNKNWON;
68     }
69 }