aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/model
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-12-07 10:09:08 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-12-07 10:09:08 +1300
commit5b57c0fdb81bae87ca487e1d0087f8927b3fd07f (patch)
treec3733bca54002ca694b6d7b83b147de87212c5eb /src/org/traccar/model
parent33b2a5c9ab70ffe7bbdd074ce430920d2a0d3941 (diff)
downloadtrackermap-server-5b57c0fdb81bae87ca487e1d0087f8927b3fd07f.tar.gz
trackermap-server-5b57c0fdb81bae87ca487e1d0087f8927b3fd07f.tar.bz2
trackermap-server-5b57c0fdb81bae87ca487e1d0087f8927b3fd07f.zip
Replace factory method with reflection
Diffstat (limited to 'src/org/traccar/model')
-rw-r--r--src/org/traccar/model/Command.java7
-rw-r--r--src/org/traccar/model/Device.java7
-rw-r--r--src/org/traccar/model/Factory.java22
-rw-r--r--src/org/traccar/model/Permission.java7
-rw-r--r--src/org/traccar/model/Position.java7
-rw-r--r--src/org/traccar/model/Schema.java7
-rw-r--r--src/org/traccar/model/Server.java7
-rw-r--r--src/org/traccar/model/User.java7
8 files changed, 7 insertions, 64 deletions
diff --git a/src/org/traccar/model/Command.java b/src/org/traccar/model/Command.java
index fb3a37795..df62164c2 100644
--- a/src/org/traccar/model/Command.java
+++ b/src/org/traccar/model/Command.java
@@ -15,7 +15,7 @@
*/
package org.traccar.model;
-public class Command extends Extensible implements Factory {
+public class Command extends Extensible {
public static final String TYPE_POSITION_SINGLE = "positionSingle";
public static final String TYPE_POSITION_PERIODIC = "positionPeriodic";
@@ -35,9 +35,4 @@ public class Command extends Extensible implements Factory {
public static final String KEY_DEVICE_PASSWORD = "devicePassword";
public static final String KEY_RADIUS = "radius";
- @Override
- public Command create() {
- return new Command();
- }
-
}
diff --git a/src/org/traccar/model/Device.java b/src/org/traccar/model/Device.java
index fd62cc691..c82581c63 100644
--- a/src/org/traccar/model/Device.java
+++ b/src/org/traccar/model/Device.java
@@ -17,12 +17,7 @@ package org.traccar.model;
import java.util.Date;
-public class Device implements Factory {
-
- @Override
- public Device create() {
- return new Device();
- }
+public class Device {
private long id;
diff --git a/src/org/traccar/model/Factory.java b/src/org/traccar/model/Factory.java
deleted file mode 100644
index 150f52b80..000000000
--- a/src/org/traccar/model/Factory.java
+++ /dev/null
@@ -1,22 +0,0 @@
-/*
- * Copyright 2015 Anton Tananaev (anton.tananaev@gmail.com)
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.traccar.model;
-
-public interface Factory {
-
- Object create();
-
-}
diff --git a/src/org/traccar/model/Permission.java b/src/org/traccar/model/Permission.java
index 065295ff9..393de2359 100644
--- a/src/org/traccar/model/Permission.java
+++ b/src/org/traccar/model/Permission.java
@@ -15,12 +15,7 @@
*/
package org.traccar.model;
-public class Permission implements Factory {
-
- @Override
- public Permission create() {
- return new Permission();
- }
+public class Permission {
private long userId;
diff --git a/src/org/traccar/model/Position.java b/src/org/traccar/model/Position.java
index 9494da042..1a38681ca 100644
--- a/src/org/traccar/model/Position.java
+++ b/src/org/traccar/model/Position.java
@@ -17,12 +17,7 @@ package org.traccar.model;
import java.util.Date;
-public class Position extends Event implements Factory {
-
- @Override
- public Position create() {
- return new Position();
- }
+public class Position extends Event {
private Date fixTime;
diff --git a/src/org/traccar/model/Schema.java b/src/org/traccar/model/Schema.java
index 3d1ce755f..0d0e58831 100644
--- a/src/org/traccar/model/Schema.java
+++ b/src/org/traccar/model/Schema.java
@@ -15,12 +15,7 @@
*/
package org.traccar.model;
-public class Schema implements Factory {
-
- @Override
- public Schema create() {
- return new Schema();
- }
+public class Schema {
private int version;
diff --git a/src/org/traccar/model/Server.java b/src/org/traccar/model/Server.java
index e96a40e27..880636a4c 100644
--- a/src/org/traccar/model/Server.java
+++ b/src/org/traccar/model/Server.java
@@ -15,12 +15,7 @@
*/
package org.traccar.model;
-public class Server implements Factory {
-
- @Override
- public Server create() {
- return new Server();
- }
+public class Server {
private long id;
diff --git a/src/org/traccar/model/User.java b/src/org/traccar/model/User.java
index 31e54752a..1531ba9e4 100644
--- a/src/org/traccar/model/User.java
+++ b/src/org/traccar/model/User.java
@@ -18,12 +18,7 @@ package org.traccar.model;
import org.traccar.helper.Hashing;
import org.traccar.web.JsonIgnore;
-public class User implements Factory {
-
- @Override
- public User create() {
- return new User();
- }
+public class User {
private long id;