潘志宝
2024-11-28 231897591c909b164defebfdb5936387ec2807d0
提交 | 用户 | 时间
149dd0 1 package com.iailab.netsdk.lib.enumeration;
H 2
3 /**
4  * @author 260611
5  * @description 是否小车占大车位
6  * @origin autoTool
7  * @date 2023/06/20 10:13:15
8  */
9 public enum EM_SMALL_OCCUPY_LARGE {
10     /**
11      * 未知
12      */
13     EM_SMALL_OCCUPY_LARGE_UNKNOWN(0,"未知"),
14     /**
15      * 未小车占大车位
16      */
17     EM_SMALL_OCCUPY_LARGE_NO(1,"未小车占大车位"),
18     /**
19      * 小车占大车位
20      */
21     EM_SMALL_OCCUPY_LARGE_YES(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_SMALL_OCCUPY_LARGE(int givenValue, String note) {
36         this.value = givenValue;
37         this.note = note;
38     }
39
40     public static String getNoteByValue(int givenValue) {
41         for (EM_SMALL_OCCUPY_LARGE enumType : EM_SMALL_OCCUPY_LARGE.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_SMALL_OCCUPY_LARGE enumType : EM_SMALL_OCCUPY_LARGE.values()) {
51             if (givenNote.equals(enumType.getNote())) {
52                 return enumType.getValue();
53             }
54         }
55         return -1;
56     }
57
58     public static EM_SMALL_OCCUPY_LARGE getEnum(int value) {
59         for (EM_SMALL_OCCUPY_LARGE e : EM_SMALL_OCCUPY_LARGE.values()) {
60             if (e.getValue() == value)
61                 return e;
62         }
63         return EM_SMALL_OCCUPY_LARGE.EM_SMALL_OCCUPY_LARGE_UNKNOWN;
64     }
65
66 }