houzhongjian
2024-10-30 a28ca3f36d0ace05966a8c0fac1e4b5fe921f882
提交 | 用户 | 时间
ce910c 1 package com.netsdk.lib.enumeration;
H 2
3 /**
4  * 界面图片状态
5  *
6  * @author 47040
7  * @since Created in 2021/4/27 19:17
8  */
9 public enum EM_MAIN_PAGE_STATE {
10     /**
11      * 未知
12      */
13     EM_MAIN_PAGE_STATE_UNKNOWN(0, "未知"),
14     /**
15      * 正常
16      */
17     EM_MAIN_PAGE_STATE_NORMAL(1, "正常"),
18     /**
19      * 待机
20      */
21     EM_MAIN_PAGE_STATE_STANDBY(2, "待机"),
22     /**
23      * 通道关闭
24      */
25     EM_MAIN_PAGE_STATE_CHANNELCLOSED(3, "通道关闭"),
26     /**
27      * 禁止通行
28      */
29     EM_MAIN_PAGE_STATE_FORBIDENTER(4, "禁止通行"),
30     /**
31      * 紧急疏散
32      */
33     EM_MAIN_PAGE_STATE_URGENTEVACUATE(5, "紧急疏散");
34
35     private final int value;
36     private final String note;
37
38     EM_MAIN_PAGE_STATE(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_MAIN_PAGE_STATE enumType : EM_MAIN_PAGE_STATE.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_MAIN_PAGE_STATE enumType : EM_MAIN_PAGE_STATE.values()) {
62             if (givenNote.equals(enumType.getNote())) {
63                 return enumType.getValue();
64             }
65         }
66         return -1;
67     }
68
69     public static EM_MAIN_PAGE_STATE getEnum(int value) {
70         for (EM_MAIN_PAGE_STATE e : EM_MAIN_PAGE_STATE.values()) {
71             if (e.getValue() == value)
72                 return e;
73         }
74         return EM_MAIN_PAGE_STATE.EM_MAIN_PAGE_STATE_UNKNOWN;
75     }
76 }