liurunyu
2024-07-24 33af27ee7a189b538452fc9adb63e0784324e009
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
package com.dy.common.mw.protocol.aepRtuStatus;
 
import com.alibaba.fastjson2.JSON ;
 
/**
 * 上下线值对象
 * 只有应用电信平台时有效
 */
@SuppressWarnings("unused")
public class OnOffLineVo {
    
    public String rtuAddr; //:"862592059434970"
    public String deviceId; //:"59a4d90bf7a04a4d3523fe15d6f3f",
    public String productId; //:"15410798",
    public String ipv4Address; //:"117.132.195.213",
    public Boolean onTrueOffFalse ;
    
    public String toString(){
        String s = "rtuAddr: " + rtuAddr  ;
        s += "\ndeviceId:" + deviceId ;
        s += "\nproductId:" + productId ;
        s += "\nipv4Address:" + ipv4Address ;
        s += "\nonTrueOffFalse:" + onTrueOffFalse ;
        return s ;
    }
    
    /**
     * 对象转成json
     * @return json
     * @throws Exception 异常
     */
    public String toJson()throws Exception{
        try{
            return JSON.toJSONString(this) ;
        }catch(Exception e){
            throw new Exception(e.getMessage() , e ) ;
        }
    }
    /**
     * json转成对象
     * @param json json
     * @return OnOffLineVo
     * @throws Exception 异常
     */
    public static OnOffLineVo jsonToObject(String json)throws Exception{
        try{
            return JSON.parseObject(json, OnOffLineVo.class) ;
        }catch(Exception e){
            throw new Exception(e.getMessage() , e ) ;
        }
    }
    
    public String getRtuAddr() {
        return rtuAddr;
    }
    public void setRtuAddr(String rtuAddr) {
        this.rtuAddr = rtuAddr;
    }
    public String getDeviceId() {
        return deviceId;
    }
    public void setDeviceId(String deviceId) {
        this.deviceId = deviceId;
    }
    public String getProductId() {
        return productId;
    }
    public void setProductId(String productId) {
        this.productId = productId;
    }
    @SuppressWarnings("unused")
    public String getIpv4Address() {
        return ipv4Address;
    }
    @SuppressWarnings("unused")
    public void setIpv4Address(String ipv4Address) {
        this.ipv4Address = ipv4Address;
    }
    @SuppressWarnings("unused")
    public Boolean getOnTrueOffFalse() {
        return onTrueOffFalse;
    }
    @SuppressWarnings("unused")
    public void setOnTrueOffFalse(Boolean onTrueOffFalse) {
        this.onTrueOffFalse = onTrueOffFalse;
    }
}