DeviceAlarmMsgBean.java
1.8 KB
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
package com.myproject.bean.qisda;
import java.util.Date;
/**
* Created by sunke on 2020/6/27.
*/
public class DeviceAlarmMsgBean {
public DeviceAlarmMsgBean() {
}
public DeviceAlarmMsgBean(String name, String msgKey, String msgValue) {
this.msgKey = msgKey;
this.msgValue = msgValue;
this.name = name;
}
/**
* 类型:0为错误, 1为正常消息
*/
private int type = 0;
private String name;
private String msgKey;
private String msgValue;
private Date startTime;
private Date updateTime = new Date();
public void updateMsg(DeviceAlarmMsgBean newBean){
this.msgValue = newBean.getMsgValue();
this.name = newBean.getName();
this.updateTime = new Date();
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getMsgKey() {
return msgKey;
}
public void setMsgKey(String msgKey) {
this.msgKey = msgKey;
}
public String getMsgValue() {
return msgValue;
}
public void setMsgValue(String msgValue) {
this.msgValue = msgValue;
}
public Date getStartTime() {
return startTime;
}
public void setStartTime(Date startTime) {
this.startTime = startTime;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
public boolean isTimeout(){
return System.currentTimeMillis() - updateTime.getTime() > 10 * 1000;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public boolean isInfoMsg(){
return type == 1;
}
}