dongyukun
2024-11-05 e8ad669f7c97d45cd23630dc101180a130d6c17e
提交 | 用户 | 时间
ce910c 1 package com.netsdk.lib.enumeration;
H 2
3
4 /** 
5 * @author 291189
6 * @description  漂浮物检测场景 
7 * @date 2022/05/09 11:40:43
8 */
9 public enum EM_FLOATINGOBJECT_DETECTION_SENCE_TYPE {
10 /**
11 未知
12 */
13 EM_FLOATINGOBJECT_DETECTION_SENCE_TYPE_UNKNOWN(0,"未知"),
14 /**
15 普通漂浮物检测
16 */
17 EM_FLOATINGOBJECT_DETECTION_SENCE_TYPE_NOMAL(1,"普通漂浮物检测"),
18 /**
19 泡沫检测
20 */
21 EM_FLOATINGOBJECT_DETECTION_SENCE_TYPE_BUBBLE(2,"泡沫检测");
22
23 private int value;
24
25 private String note;
26
27 public String getNote() {
28         return note;
29     }
30
31 public int getValue() {
32         return value;
33     }
34
35 EM_FLOATINGOBJECT_DETECTION_SENCE_TYPE(int givenValue, String note) {
36         this.value = givenValue;
37         this.note = note;
38     }
39
40 public static String getNoteByValue(int givenValue) {
41         for (EM_FLOATINGOBJECT_DETECTION_SENCE_TYPE enumType : EM_FLOATINGOBJECT_DETECTION_SENCE_TYPE.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_FLOATINGOBJECT_DETECTION_SENCE_TYPE enumType : EM_FLOATINGOBJECT_DETECTION_SENCE_TYPE.values()) {
51             if (givenNote.equals(enumType.getNote())) {
52                 return enumType.getValue();
53             }
54         }
55         return -1;
56     }
57
58 public static EM_FLOATINGOBJECT_DETECTION_SENCE_TYPE getEnum(int value) {
59         for (EM_FLOATINGOBJECT_DETECTION_SENCE_TYPE e : EM_FLOATINGOBJECT_DETECTION_SENCE_TYPE.values()) {
60             if (e.getValue() == value)
61                 return e;
62         }
63         return EM_FLOATINGOBJECT_DETECTION_SENCE_TYPE.EM_FLOATINGOBJECT_DETECTION_SENCE_TYPE_UNKNOWN;
64     }
65
66 }