|
|
@@ -1,49 +1,41 @@
|
|
|
package cz.senslog.telemetry.database.domain;
|
|
|
|
|
|
-import java.util.Collections;
|
|
|
-import java.util.List;
|
|
|
|
|
|
public class Unit {
|
|
|
|
|
|
- private long unitId;
|
|
|
+ private final long unitId;
|
|
|
+ private final String name;
|
|
|
+ private final String imei;
|
|
|
+ private final String description;
|
|
|
|
|
|
- private String imei;
|
|
|
-
|
|
|
- private List<Sensor> sensors;
|
|
|
-
|
|
|
- public static Unit of(long unitId, String imei, List<Sensor> sensors) {
|
|
|
- Unit u = new Unit();
|
|
|
- u.setUnitId(unitId);
|
|
|
- u.setImei(imei);
|
|
|
- u.setSensors(sensors);
|
|
|
- return u;
|
|
|
+ public static Unit of(long unitId, String name, String imei, String description) {
|
|
|
+ return new Unit(unitId, name, imei, description);
|
|
|
}
|
|
|
|
|
|
public static Unit of(long unitId, String imei) {
|
|
|
- return of(unitId, imei, Collections.emptyList());
|
|
|
+ return of(unitId, null, imei, null);
|
|
|
+ }
|
|
|
+
|
|
|
+ private Unit(long unitId, String name, String imei, String description) {
|
|
|
+ this.unitId = unitId;
|
|
|
+ this.name = name;
|
|
|
+ this.imei = imei;
|
|
|
+ this.description = description;
|
|
|
}
|
|
|
|
|
|
public long getUnitId() {
|
|
|
return unitId;
|
|
|
}
|
|
|
|
|
|
- public void setUnitId(long unitId) {
|
|
|
- this.unitId = unitId;
|
|
|
+ public String getName() {
|
|
|
+ return name;
|
|
|
}
|
|
|
|
|
|
public String getImei() {
|
|
|
return imei;
|
|
|
}
|
|
|
|
|
|
- public void setImei(String imei) {
|
|
|
- this.imei = imei;
|
|
|
- }
|
|
|
-
|
|
|
- public List<Sensor> getSensors() {
|
|
|
- return sensors;
|
|
|
- }
|
|
|
-
|
|
|
- public void setSensors(List<Sensor> sensors) {
|
|
|
- this.sensors = sensors;
|
|
|
+ public String getDescription() {
|
|
|
+ return description;
|
|
|
}
|
|
|
}
|