潘志宝
2024-12-12 b095cfc785d4a280ffaae086503a6a0e4f1fa4c1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
package com.iailab.netsdk.lib.enumeration;
 
 
/**
 * @author 260611
 * @description 物模型服务类型
 * @date 2022/04/20 10:16:57
 */
public enum EM_THINGS_SERVICE_TYPE {
    /**
     * 阀门控制,入参:NET_IN_THINGS_SERVICE_VALVECONTROL,出参:NET_OUT_THINGS_SERVICE_VALVECONTROL
     */
    EM_THINGS_SERVICE_TYPE_VALVECONTROL(0, "阀门控制,入参:NET_IN_THINGS_SERVICE_VALVECONTROL,出参:NET_OUT_THINGS_SERVICE_VALVECONTROL"),
    /**
     * 电量清零,入参:NET_IN_THINGS_SERVICE_CHARGECLEAR,出参:NET_OUT_THINGS_SERVICE_CHARGECLEAR
     */
    EM_THINGS_SERVICE_TYPE_CHARGECLEAR(1, "电量清零,入参:NET_IN_THINGS_SERVICE_CHARGECLEAR,出参:NET_OUT_THINGS_SERVICE_CHARGECLEAR"),
    /**
     * 漏电自检,入参:NET_IN_THINGS_SERVICE_LEAKCURTPOST,出参:NET_OUT_THINGS_SERVICE_LEAKCURTPOST
     */
    EM_THINGS_SERVICE_TYPE_LEAKCURTPOST(2, "漏电自检,入参:NET_IN_THINGS_SERVICE_LEAKCURTPOST,出参:NET_OUT_THINGS_SERVICE_LEAKCURTPOST"),
    /**
     * 漏电自检异步,入参:NET_IN_THINGS_SERVICE_LEAKCURTPOSTASYNC,出参:NET_OUT_THINGS_SERVICE_LEAKCURTPOSTASYNC
     */
    EM_THINGS_SERVICE_TYPE_LEAKCURTPOSTASYNC(3, "漏电自检异步,入参:NET_IN_THINGS_SERVICE_LEAKCURTPOSTASYNC,出参:NET_OUT_THINGS_SERVICE_LEAKCURTPOSTASYNC"),
    /**
     * 空开红蓝灯闪烁(寻找空开),入参:NET_IN_THINGS_SERVICE_AIRSWITHFIND,出参:NET_OUT_THINGS_SERVICE_AIRSWITHFIND
     */
    EM_THINGS_SERVICE_TYPE_AIRSWITHFIND(4, "空开红蓝灯闪烁(寻找空开),入参:NET_IN_THINGS_SERVICE_AIRSWITHFIND,出参:NET_OUT_THINGS_SERVICE_AIRSWITHFIND"),
    /**
     * 空开恢复出厂设置,入参:NET_IN_THINGS_SERVICE_AIRSWITHRESET,出参:NET_OUT_THINGS_SERVICE_AIRSWITHRESET
     */
    EM_THINGS_SERVICE_TYPE_AIRSWITHRESET(5, "空开恢复出厂设置,入参:NET_IN_THINGS_SERVICE_AIRSWITHRESET,出参:NET_OUT_THINGS_SERVICE_AIRSWITHRESET"),
    /**
     * 添加联动规则,入参:NET_IN_THINGS_SERVICE_ADDRULE,出参:NET_OUT_THINGS_SERVICE_ADDRULE
     */
    EM_THINGS_SERVICE_TYPE_ADDRULE(6, "添加联动规则,入参:NET_IN_THINGS_SERVICE_ADDRULE,出参:NET_OUT_THINGS_SERVICE_ADDRULE"),
    /**
     * 删除联动规则,入参:NET_IN_THINGS_SERVICE_DELRULE,出参:NET_OUT_THINGS_SERVICE_DELRULE
     */
    EM_THINGS_SERVICE_TYPE_DELRULE(7, "删除联动规则,入参:NET_IN_THINGS_SERVICE_DELRULE,出参:NET_OUT_THINGS_SERVICE_DELRULE"),
    /**
     * 修改联动规则,入参:NET_IN_THINGS_SERVICE_MODRULE,出参:NET_OUT_THINGS_SERVICE_MODRULE
     */
    EM_THINGS_SERVICE_TYPE_MODRULE(8, "修改联动规则,入参:NET_IN_THINGS_SERVICE_MODRULE,出参:NET_OUT_THINGS_SERVICE_MODRULE"),
    /**
     * 查询联动规则,入参:NET_IN_THINGS_SERVICE_QUERULE,出参:NET_OUT_THINGS_SERVICE_QUERULE
     */
    EM_THINGS_SERVICE_TYPE_QUERULE(9, "查询联动规则,入参:NET_IN_THINGS_SERVICE_QUERULE,出参:NET_OUT_THINGS_SERVICE_QUERULE"),
    /**
     * 使能联动规则,入参:NET_IN_THINGS_SERVICE_ENABLE,出参:NET_OUT_THINGS_SERVICE_ENABLE
     */
    EM_THINGS_SERVICE_TYPE_ENABLERULE(10, "使能联动规则,入参:NET_IN_THINGS_SERVICE_ENABLE,出参:NET_OUT_THINGS_SERVICE_ENABLE"),
    /**
     * 添加设备,入参:NET_IN_THINGS_SERVICE_ADDDEVICE,出参:NET_OUT_THINGS_SERVICE_ADDDEVICE
     */
    EM_THINGS_SERVICE_TYPE_ADDDEVICE(11, "添加设备,入参:NET_IN_THINGS_SERVICE_ADDDEVICE,出参:NET_OUT_THINGS_SERVICE_ADDDEVICE"),
    /**
     * 删除子设备,入参:NET_IN_THINGS_SERVICE_DELDEVICE,出参:NET_OUT_THINGS_SERVICE_DELDEVICE
     */
    EM_THINGS_SERVICE_TYPE_DELDEVICE(12, "删除子设备,入参:NET_IN_THINGS_SERVICE_DELDEVICE,出参:NET_OUT_THINGS_SERVICE_DELDEVICE"),
    /**
     * 子设备替换,入参:NET_IN_THINGS_SERVICE_DEVREPLACE,出参:NET_OUT_THINGS_SERVICE_DEVREPLACE
     */
    EM_THINGS_SERVICE_TYPE_DEVREPLACE(13, "子设备替换,入参:NET_IN_THINGS_SERVICE_DEVREPLACE,出参:NET_OUT_THINGS_SERVICE_DEVREPLACE"),
    /**
     * 离线日志清除,入参:NET_IN_THINGS_SERVICE_OFFLINELOGCLEAN,出参:NET_OUT_THINGS_SERVICE_OFFLINELOGCLEAN
     */
    EM_THINGS_SERVICE_TYPE_OFFLINELOGCLEAN(14, "离线日志清除,入参:NET_IN_THINGS_SERVICE_OFFLINELOGCLEAN,出参:NET_OUT_THINGS_SERVICE_OFFLINELOGCLEAN"),
    /**
     * 获取所有空开当前报警状态,入参:NET_IN_THINGS_SERVICE_CURRENTSTATUSGET,出参:NET_OUT_THINGS_SERVICE_CURRENTSTATUSGET
     */
    EM_THINGS_SERVICE_TYPE_CURRENTSTATUSGET(15, "获取所有空开当前报警状态,入参:NET_IN_THINGS_SERVICE_CURRENTSTATUSGET,出参:NET_OUT_THINGS_SERVICE_CURRENTSTATUSGET");
 
    private int value;
 
    private String note;
 
    public String getNote() {
        return note;
    }
 
    public int getValue() {
        return value;
    }
 
    EM_THINGS_SERVICE_TYPE(int givenValue, String note) {
        this.value = givenValue;
        this.note = note;
    }
 
    public static String getNoteByValue(int givenValue) {
        for (EM_THINGS_SERVICE_TYPE enumType : EM_THINGS_SERVICE_TYPE.values()) {
            if (givenValue == enumType.getValue()) {
                return enumType.getNote();
            }
        }
        return null;
    }
 
    public static int getValueByNote(String givenNote) {
        for (EM_THINGS_SERVICE_TYPE enumType : EM_THINGS_SERVICE_TYPE.values()) {
            if (givenNote.equals(enumType.getNote())) {
                return enumType.getValue();
            }
        }
        return -1;
    }
 
    public static EM_THINGS_SERVICE_TYPE getEnum(int value) {
        for (EM_THINGS_SERVICE_TYPE e : EM_THINGS_SERVICE_TYPE.values()) {
            if (e.getValue() == value)
                return e;
        }
        return EM_THINGS_SERVICE_TYPE.EM_THINGS_SERVICE_TYPE_VALVECONTROL;
    }
 
}