aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/model/Command.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/model/Command.java')
-rw-r--r--src/org/traccar/model/Command.java53
1 files changed, 26 insertions, 27 deletions
diff --git a/src/org/traccar/model/Command.java b/src/org/traccar/model/Command.java
index 56e709150..09bb81a74 100644
--- a/src/org/traccar/model/Command.java
+++ b/src/org/traccar/model/Command.java
@@ -1,32 +1,6 @@
package org.traccar.model;
-import java.util.LinkedHashMap;
-import java.util.Map;
-
-public class Command implements Factory {
-
- @Override
- public Command create() {
- return new Command();
- }
-
- private long deviceId;
- public long getDeviceId() { return deviceId; }
- public void setDeviceId(long deviceId) { this.deviceId = deviceId; }
-
- private String type;
- public String getType() { return type; }
- public void setType(String type) { this.type = type; }
-
- private Map<String, Object> attributes = new LinkedHashMap<>();
- public Map<String, Object> getAttributes() { return attributes; }
- public void setAttributes(Map<String, Object> attributes) { this.attributes = attributes; }
-
- public void set(String key, boolean value) { attributes.put(key, value); }
- public void set(String key, int value) { attributes.put(key, value); }
- public void set(String key, long value) { attributes.put(key, value); }
- public void set(String key, double value) { attributes.put(key, value); }
- public void set(String key, String value) { if (value != null && !value.isEmpty()) attributes.put(key, value); }
+public class Command extends Extensible implements Factory {
public static final String TYPE_POSITION_SINGLE = "positionSingle";
public static final String TYPE_POSITION_PERIODIC = "positionPeriodic";
@@ -42,4 +16,29 @@ public class Command implements Factory {
public static final String KEY_TIMEZONE = "timezone";
public static final String KEY_DEVICE_PASSWORD = "devicePassword";
+ @Override
+ public Command create() {
+ return new Command();
+ }
+
+ private long deviceId;
+
+ public long getDeviceId() {
+ return deviceId;
+ }
+
+ public void setDeviceId(long deviceId) {
+ this.deviceId = deviceId;
+ }
+
+ private String type;
+
+ public String getType() {
+ return type;
+ }
+
+ public void setType(String type) {
+ this.type = type;
+ }
+
}