dongyukun
2024-11-05 e8ad669f7c97d45cd23630dc101180a130d6c17e
提交 | 用户 | 时间
ce910c 1 package com.netsdk.lib.enumeration;
H 2
3 /**
4  * @author 251823
5  * @description 红绿灯方案/可变车道方案
6  * @date 2021/09/28
7  */
8 public enum EM_CTRL_SCHEME {
9     // 未知
10     EM_CTRL_SCHEME_UNKNOWN(0, "未知"),
11     // 进入备份模式(红绿灯)
12     EM_CTRL_SCHEME_REDYELLOW_BACKUP(150, "进入备份模式(红绿灯)"),
13     // 正常退出备份模式(红绿灯)
14     EM_CTRL_SCHEME_REDYELLOW_BACKUP_NORMAL_QUIT(151, "正常退出备份模式(红绿灯)"),
15     // 异常退出备份模式(红绿灯)
16     EM_CTRL_SCHEME_REDYELLOW_BACKUP_ABNORMAL_QUIT(152, "异常退出备份模式(红绿灯)"),
17     // 异常退出备份模式(可变车道)
18     EM_CTRL_SCHEME_VARLANE_BACKUP(153, "异常退出备份模式(可变车道)"),
19     // 正常退出备份模式(可变车道)
20     EM_CTRL_SCHEME_VARLANE_BACKUP_NORMAL_QUIT(154, "正常退出备份模式(可变车道)"),
21     // 异常退出备份模式(可变车道)
22     EM_CTRL_SCHEME_VARLANE_BACKUP_ABNORMAL_QUIT(155, "异常退出备份模式(可变车道)");
23
24     private int value;
25     private String note;
26
27     private EM_CTRL_SCHEME(int givenValue, String note) {
28         this.value = givenValue;
29         this.note = note;
30     }
31
32     public String getNote() {
33         return note;
34     }
35
36     public int getValue() {
37         return value;
38     }
39
40     public static String getNoteByValue(int givenValue) {
41         for (EM_CTRL_SCHEME enumType : EM_CTRL_SCHEME.values()) {
42             if (givenValue == enumType.getValue()) {
43                 return enumType.getNote();
44             }
45         }
46         return null;
47     }
48
49     public static int getValueByNote(String givenNote) {
50         for (EM_CTRL_SCHEME enumType : EM_CTRL_SCHEME.values()) {
51             if (givenNote.equals(enumType.getNote())) {
52                 return enumType.getValue();
53             }
54         }
55         return -1;
56     }
57
58 }