-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathIotSensorRules.java
55 lines (41 loc) · 1.28 KB
/
IotSensorRules.java
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
package kafkastreams.iot.model;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import java.util.List;
//A,{"id":"A", "rules":[{"ruleName":"max_temperature", "metricName":"temp", "metricValue":22, "condition":">"}, {"ruleName":"min_humidity", "metricName":"hum", "metricValue":50, "condition":"<"}]}
public class IotSensorRules {
@JsonProperty("id")
String id;
@JsonProperty("rules")
List<IotSensorRule> rules;
@JsonCreator
public IotSensorRules(@JsonProperty("id") String id, @JsonProperty("rules") List<IotSensorRule> rules) {
this.id = id;
this.rules = rules;
}
@JsonProperty
public String getId() {
return id;
}
@JsonProperty
public void setId(String id) {
this.id = id;
}
@JsonProperty
public List<IotSensorRule> getRules() {
return rules;
}
@JsonProperty
public void setRules(List<IotSensorRule> rules) {
this.rules = rules;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder().append("[");
for (IotSensorRule rule : rules) {
builder.append(rule.toString());
}
builder.append("]");
return builder.toString();
}
}