Updating for requester filter and to be able to have multiple calls for

any type of device.
This commit is contained in:
Admin
2016-11-21 16:45:01 -06:00
parent a3f5b47260
commit dcc4041d7d
4 changed files with 1317 additions and 1206 deletions

View File

@@ -5,7 +5,7 @@
<groupId>com.bwssystems.HABridge</groupId>
<artifactId>ha-bridge</artifactId>
<version>3.5.1</version>
<version>3.5.1a</version>
<packaging>jar</packaging>
<name>HA Bridge</name>

View File

@@ -1,10 +1,28 @@
package com.bwssystems.HABridge.api;
public class CallItem {
private String type;
private String requesterAddress;
private String item;
private Integer count;
private Integer delay;
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getRequesterAddress() {
return requesterAddress;
}
public void setRequesterAddress(String requesterAddress) {
this.requesterAddress = requesterAddress;
}
public String getItem() {
return item;
}

View File

@@ -0,0 +1,25 @@
package com.bwssystems.HABridge.api;
import java.lang.reflect.Type;
import com.google.gson.JsonDeserializationContext;
import com.google.gson.JsonDeserializer;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
public class CallItemDeserializer implements JsonDeserializer<CallItem> {
@Override
public CallItem deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext ctx)
{
CallItem aCallItem = new CallItem();
JsonObject jsonObj = json.getAsJsonObject();
JsonElement jsonElem;
jsonElem = jsonObj.get("item");
aCallItem.setItem(jsonElem.getAsString());
jsonElem = jsonObj.get("delay");
aCallItem.setDelay(jsonElem.getAsInt());
jsonElem = jsonObj.get("count");
aCallItem.setCount(jsonElem.getAsInt());
return aCallItem;
}
}

File diff suppressed because it is too large Load Diff