diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-05-03 12:09:00 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-05-03 12:09:00 +1200 |
commit | 18127a2dfc362ffd7de4110e013a10a9f894469b (patch) | |
tree | 24ced00567acbc751985b71ffd99ce067213a34d /src/org/traccar/model/Data.java | |
parent | 427113e0aabf1b8ab54288263c3e809f292a5a05 (diff) | |
download | trackermap-server-18127a2dfc362ffd7de4110e013a10a9f894469b.tar.gz trackermap-server-18127a2dfc362ffd7de4110e013a10a9f894469b.tar.bz2 trackermap-server-18127a2dfc362ffd7de4110e013a10a9f894469b.zip |
Implmenet reflection json conversion
Diffstat (limited to 'src/org/traccar/model/Data.java')
-rw-r--r-- | src/org/traccar/model/Data.java | 30 |
1 files changed, 1 insertions, 29 deletions
diff --git a/src/org/traccar/model/Data.java b/src/org/traccar/model/Data.java index d49bb0da6..d8f898317 100644 --- a/src/org/traccar/model/Data.java +++ b/src/org/traccar/model/Data.java @@ -15,17 +15,11 @@ */ package org.traccar.model; -import java.text.ParseException; import java.util.Date; import java.util.LinkedHashMap; import java.util.Map; -import javax.json.Json; -import javax.json.JsonObject; -import javax.json.JsonObjectBuilder; -import org.traccar.database.Convertable; -import org.traccar.database.ObjectConverter; -public class Data implements Convertable { +public class Data { private long id; public long getId() { return id; } @@ -57,26 +51,4 @@ public class Data implements Convertable { return MiscFormatter.toXmlString(other); } - @Override - public JsonObject toJson() { - JsonObjectBuilder json = Json.createObjectBuilder(); - json.add("id", id); - json.add("protocol", protocol); - json.add("deviceId", deviceId); - json.add("serverTime", ObjectConverter.dateFormat.format(serverTime)); - json.add("deviceTime", ObjectConverter.dateFormat.format(deviceTime)); - //json.add("extendedInfo", extendedInfo); - return json.build(); - } - - @Override - public void fromJson(JsonObject json) throws ParseException { - id = json.getJsonNumber("id").longValue(); - protocol = json.getString("protocol"); - deviceId = json.getJsonNumber("deviceId").longValue(); - serverTime = ObjectConverter.dateFormat.parse(json.getString("serverTime")); - deviceTime = ObjectConverter.dateFormat.parse(json.getString("deviceTime")); - //extendedInfo = json.getString("extendedInfo"); - } - } |