LedJson.java
1.1 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
package com.air.led;
import com.google.gson.Gson;
public class LedJson {
/**
*
* @param ledCode
* Led屏的编号
* @param opType
* 0屏复位,1屏上显示车牌,3查询当前屏上显示内容
* @param text
* 想让led屏显示的文字
*/
public LedJson(String ledCode, int opType, String text) {
setLedCode(ledCode);
setOpType(opType);
if ("空闲".equalsIgnoreCase(text)) {
setOpType(0);
} else {
setText(text);
}
}
private String ledCode;
private int OpType;
private String text;
private int color;
public String getLedCode() {
return ledCode;
}
public void setLedCode(String ledCode) {
this.ledCode = ledCode;
}
public int getOpType() {
return OpType;
}
public void setOpType(int opType) {
OpType = opType;
}
public String getText() {
return text;
}
public void setText(String text) {
this.text = text;
}
public int getColor() {
return color;
}
public void setColor(int color) {
this.color = color;
}
@Override
public String toString() {
return new Gson().toJson(this);
}
}