From 0d10d759a6bc5485d715637eb42f9e4f1bb5614f Mon Sep 17 00:00:00 2001 From: Claudio Maggioni Date: Tue, 12 May 2020 17:14:25 +0200 Subject: [PATCH 1/2] Removed @NotNull from models --- .../usi/inf/sa4/sanmarinoes/smarthut/models/Automation.java | 4 +--- .../ch/usi/inf/sa4/sanmarinoes/smarthut/models/Dimmable.java | 3 --- .../usi/inf/sa4/sanmarinoes/smarthut/models/RegularLight.java | 2 -- .../java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Room.java | 3 --- .../ch/usi/inf/sa4/sanmarinoes/smarthut/models/Scene.java | 4 ---- .../inf/sa4/sanmarinoes/smarthut/models/ScenePriority.java | 2 -- .../inf/sa4/sanmarinoes/smarthut/models/SecurityCamera.java | 2 -- .../ch/usi/inf/sa4/sanmarinoes/smarthut/models/SmartPlug.java | 2 -- .../ch/usi/inf/sa4/sanmarinoes/smarthut/models/State.java | 3 --- .../usi/inf/sa4/sanmarinoes/smarthut/models/Thermostat.java | 3 +-- 10 files changed, 2 insertions(+), 26 deletions(-) diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Automation.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Automation.java index 48a9e44..cb04e9d 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Automation.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Automation.java @@ -6,7 +6,6 @@ import java.util.HashSet; import java.util.Set; import javax.persistence.*; import javax.validation.constraints.NotEmpty; -import javax.validation.constraints.NotNull; import lombok.Data; @Data @@ -24,7 +23,6 @@ public class Automation { @GsonExclude private User user; - @NotNull @Column(name = "user_id", nullable = false) @GsonExclude private Long userId; @@ -38,5 +36,5 @@ public class Automation { @OneToMany(mappedBy = "automation", orphanRemoval = true, cascade = CascadeType.REMOVE) private Set> conditions = new HashSet<>(); - @NotNull @NotEmpty private String name; + @NotEmpty private String name; } diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Dimmable.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Dimmable.java index a440e37..37f40e1 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Dimmable.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Dimmable.java @@ -6,7 +6,6 @@ import java.util.Set; import javax.persistence.*; import javax.validation.constraints.Max; import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; import lombok.Getter; import lombok.Setter; @@ -26,14 +25,12 @@ public class Dimmable extends Switchable implements RangeTriggerable { private Set dimmers; /** The light intensity value. Goes from 0 (off) to 100 (on) */ - @NotNull @Column(nullable = false) @Min(0) @Max(100) @Getter private Integer intensity = 0; - @NotNull @Column(nullable = false) @Getter @Setter diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/RegularLight.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/RegularLight.java index d035b19..feac0fb 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/RegularLight.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/RegularLight.java @@ -2,7 +2,6 @@ package ch.usi.inf.sa4.sanmarinoes.smarthut.models; import javax.persistence.Column; import javax.persistence.Entity; -import javax.validation.constraints.NotNull; import lombok.Getter; import lombok.Setter; @@ -12,7 +11,6 @@ public class RegularLight extends Switchable implements BooleanTriggerable { /** Whether the light is on or not */ @Column(name = "light_on", nullable = false) - @NotNull @Getter @Setter boolean on; diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Room.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Room.java index 9e3ebc9..6785d90 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Room.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Room.java @@ -5,7 +5,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashSet; import java.util.Set; import javax.persistence.*; -import javax.validation.constraints.NotNull; /** Represents a room in the house owned by the user */ @Entity @@ -42,12 +41,10 @@ public class Room { * User that owns the house this room is in as a foreign key id. To use when updating and * inserting from a REST call. */ - @NotNull @Column(name = "user_id", nullable = false) private Long userId; /** The user given name of this room (e.g. 'Master bedroom') */ - @NotNull @Column(nullable = false) private String name; diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Scene.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Scene.java index 83a9367..63cccb4 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Scene.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Scene.java @@ -5,7 +5,6 @@ import io.swagger.annotations.ApiModelProperty; import java.util.HashSet; import java.util.Set; import javax.persistence.*; -import javax.validation.constraints.NotNull; /** * Represent a collection of state changes to devices even in different rooms but belonging to the @@ -25,7 +24,6 @@ public class Scene { @GsonExclude private User user; - @NotNull @Column(name = "user_id", nullable = false) @GsonExclude private Long userId; @@ -35,12 +33,10 @@ public class Scene { private Set> states = new HashSet<>(); /** The user given name of this room (e.g. 'Master bedroom') */ - @NotNull @Column(nullable = false) private String name; @Column(nullable = false) - @NotNull private Icon icon; /** Determines whether a guest can access this scene */ diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/ScenePriority.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/ScenePriority.java index e975d08..8363853 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/ScenePriority.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/ScenePriority.java @@ -11,7 +11,6 @@ import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.PreRemove; import javax.validation.constraints.Min; -import javax.validation.constraints.NotNull; @Entity public class ScenePriority { @@ -30,7 +29,6 @@ public class ScenePriority { @Column(name = "automation_id", nullable = false) private Long automationId; - @NotNull @Min(0) @Column(nullable = false) private Integer priority; diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/SecurityCamera.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/SecurityCamera.java index 218ba4a..ccb1224 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/SecurityCamera.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/SecurityCamera.java @@ -2,7 +2,6 @@ package ch.usi.inf.sa4.sanmarinoes.smarthut.models; import javax.persistence.Column; import javax.persistence.Entity; -import javax.validation.constraints.NotNull; @Entity public class SecurityCamera extends Switchable implements BooleanTriggerable { @@ -13,7 +12,6 @@ public class SecurityCamera extends Switchable implements BooleanTriggerable { } @Column(name = "camera_on", nullable = false) - @NotNull private boolean on; @Column(name = "video", nullable = false) diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/SmartPlug.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/SmartPlug.java index 10fcacf..b69e3e7 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/SmartPlug.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/SmartPlug.java @@ -3,7 +3,6 @@ package ch.usi.inf.sa4.sanmarinoes.smarthut.models; import java.math.BigDecimal; import javax.persistence.Column; import javax.persistence.Entity; -import javax.validation.constraints.NotNull; /** A smart plug that can be turned either on or off */ @Entity @@ -14,7 +13,6 @@ public class SmartPlug extends Switchable implements BooleanTriggerable { /** The total amount of power that the smart plug has consumed represented in W/h */ @Column(precision = 13, scale = 3) - @NotNull private BigDecimal totalConsumption = BigDecimal.ZERO; /** Whether the smart plug is on */ diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/State.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/State.java index 31cd69c..8637500 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/State.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/State.java @@ -3,7 +3,6 @@ package ch.usi.inf.sa4.sanmarinoes.smarthut.models; import ch.usi.inf.sa4.sanmarinoes.smarthut.config.GsonExclude; import io.swagger.annotations.ApiModelProperty; import javax.persistence.*; -import javax.validation.constraints.NotNull; /** * Represents instructions on how to change the state of a particular device. Many states (plus @@ -30,7 +29,6 @@ public abstract class State { * from a REST call. */ @Column(name = "device_id", nullable = false) - @NotNull private Long deviceId; @ManyToOne @@ -39,7 +37,6 @@ public abstract class State { private Scene scene; @Column(name = "scene_id", nullable = false) - @NotNull private Long sceneId; /** Sets the state of the connected device to the state represented by this object. */ diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Thermostat.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Thermostat.java index abcc1cb..a2a71a1 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Thermostat.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/models/Thermostat.java @@ -5,7 +5,6 @@ import java.math.BigDecimal; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Transient; -import javax.validation.constraints.NotNull; /** A thermostat capable of controlling cooling and heating. */ @Entity @@ -72,7 +71,7 @@ public class Thermostat extends Switchable implements BooleanTriggerable { Sensor.TYPICAL_VALUES.get(Sensor.SensorType.TEMPERATURE); /** State of this thermostat */ - @Column @NotNull private Thermostat.Mode mode; + @Column private Thermostat.Mode mode; @Transient private BigDecimal measuredTemperature; From 6223434979bbd2b29f5ab1fdc7a408343305d856 Mon Sep 17 00:00:00 2001 From: Claudio Maggioni Date: Tue, 12 May 2020 17:20:19 +0200 Subject: [PATCH 2/2] Removed duplication --- .../BooleanConditionController.java | 8 ++-- .../controller/BooleanTriggerController.java | 8 ++-- .../controller/RangeConditionController.java | 8 ++-- .../controller/RangeTriggerController.java | 8 ++-- ...BooleanConditionOrTriggerSaveRequest.java} | 2 +- .../dto/BooleanConditionSaveRequest.java | 42 ------------------- ...> RangeConditionOrTriggerSaveRequest.java} | 2 +- .../dto/RangeConditionSaveRequest.java | 19 --------- 8 files changed, 18 insertions(+), 79 deletions(-) rename src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/dto/{BooleanTriggerSaveRequest.java => BooleanConditionOrTriggerSaveRequest.java} (82%) delete mode 100644 src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/dto/BooleanConditionSaveRequest.java rename src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/dto/{RangeTriggerSaveRequest.java => RangeConditionOrTriggerSaveRequest.java} (87%) delete mode 100644 src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/dto/RangeConditionSaveRequest.java diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/BooleanConditionController.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/BooleanConditionController.java index ddcb880..e605043 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/BooleanConditionController.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/BooleanConditionController.java @@ -1,6 +1,6 @@ package ch.usi.inf.sa4.sanmarinoes.smarthut.controller; -import ch.usi.inf.sa4.sanmarinoes.smarthut.dto.BooleanConditionSaveRequest; +import ch.usi.inf.sa4.sanmarinoes.smarthut.dto.BooleanConditionOrTriggerSaveRequest; import ch.usi.inf.sa4.sanmarinoes.smarthut.error.NotFoundException; import ch.usi.inf.sa4.sanmarinoes.smarthut.models.BooleanCondition; import ch.usi.inf.sa4.sanmarinoes.smarthut.models.BooleanConditionRepository; @@ -29,7 +29,7 @@ public class BooleanConditionController { return booleanConditionRepository.findAllByAutomationId(automationId); } - private BooleanCondition save(BooleanCondition newRL, BooleanConditionSaveRequest s) { + private BooleanCondition save(BooleanCondition newRL, BooleanConditionOrTriggerSaveRequest s) { newRL.setDeviceId(s.getDeviceId()); newRL.setAutomationId(s.getAutomationId()); newRL.setOn(s.isOn()); @@ -39,13 +39,13 @@ public class BooleanConditionController { @PostMapping public BooleanCondition create( - @Valid @RequestBody BooleanConditionSaveRequest booleanTriggerSaveRequest) { + @Valid @RequestBody BooleanConditionOrTriggerSaveRequest booleanTriggerSaveRequest) { return save(new BooleanCondition(), booleanTriggerSaveRequest); } @PutMapping public BooleanCondition update( - @Valid @RequestBody BooleanConditionSaveRequest booleanTriggerSaveRequest) + @Valid @RequestBody BooleanConditionOrTriggerSaveRequest booleanTriggerSaveRequest) throws NotFoundException { return save( booleanConditionRepository diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/BooleanTriggerController.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/BooleanTriggerController.java index 46af99e..d31b8e2 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/BooleanTriggerController.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/BooleanTriggerController.java @@ -1,6 +1,6 @@ package ch.usi.inf.sa4.sanmarinoes.smarthut.controller; -import ch.usi.inf.sa4.sanmarinoes.smarthut.dto.BooleanTriggerSaveRequest; +import ch.usi.inf.sa4.sanmarinoes.smarthut.dto.BooleanConditionOrTriggerSaveRequest; import ch.usi.inf.sa4.sanmarinoes.smarthut.error.NotFoundException; import ch.usi.inf.sa4.sanmarinoes.smarthut.models.BooleanTrigger; import ch.usi.inf.sa4.sanmarinoes.smarthut.models.BooleanTriggerRepository; @@ -29,7 +29,7 @@ public class BooleanTriggerController { return booleanTriggerRepository.findAllByAutomationId(automationId); } - private BooleanTrigger save(BooleanTrigger newRL, BooleanTriggerSaveRequest s) { + private BooleanTrigger save(BooleanTrigger newRL, BooleanConditionOrTriggerSaveRequest s) { newRL.setDeviceId(s.getDeviceId()); newRL.setAutomationId(s.getAutomationId()); newRL.setOn(s.isOn()); @@ -39,13 +39,13 @@ public class BooleanTriggerController { @PostMapping public BooleanTrigger create( - @Valid @RequestBody BooleanTriggerSaveRequest booleanTriggerSaveRequest) { + @Valid @RequestBody BooleanConditionOrTriggerSaveRequest booleanTriggerSaveRequest) { return save(new BooleanTrigger(), booleanTriggerSaveRequest); } @PutMapping public BooleanTrigger update( - @Valid @RequestBody BooleanTriggerSaveRequest booleanTriggerSaveRequest) + @Valid @RequestBody BooleanConditionOrTriggerSaveRequest booleanTriggerSaveRequest) throws NotFoundException { return save( booleanTriggerRepository diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/RangeConditionController.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/RangeConditionController.java index 5055c61..ea9a911 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/RangeConditionController.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/RangeConditionController.java @@ -1,6 +1,6 @@ package ch.usi.inf.sa4.sanmarinoes.smarthut.controller; -import ch.usi.inf.sa4.sanmarinoes.smarthut.dto.RangeConditionSaveRequest; +import ch.usi.inf.sa4.sanmarinoes.smarthut.dto.RangeConditionOrTriggerSaveRequest; import ch.usi.inf.sa4.sanmarinoes.smarthut.error.NotFoundException; import ch.usi.inf.sa4.sanmarinoes.smarthut.models.RangeCondition; import ch.usi.inf.sa4.sanmarinoes.smarthut.models.RangeConditionRepository; @@ -29,7 +29,7 @@ public class RangeConditionController { return rangeConditionRepository.findAllByAutomationId(automationId); } - private RangeCondition save(RangeCondition newRL, RangeConditionSaveRequest s) { + private RangeCondition save(RangeCondition newRL, RangeConditionOrTriggerSaveRequest s) { newRL.setDeviceId(s.getDeviceId()); newRL.setAutomationId(s.getAutomationId()); newRL.setOperator(s.getOperator()); @@ -40,13 +40,13 @@ public class RangeConditionController { @PostMapping public RangeCondition create( - @Valid @RequestBody RangeConditionSaveRequest booleanTriggerSaveRequest) { + @Valid @RequestBody RangeConditionOrTriggerSaveRequest booleanTriggerSaveRequest) { return save(new RangeCondition(), booleanTriggerSaveRequest); } @PutMapping public RangeCondition update( - @Valid @RequestBody RangeConditionSaveRequest booleanTriggerSaveRequest) + @Valid @RequestBody RangeConditionOrTriggerSaveRequest booleanTriggerSaveRequest) throws NotFoundException { return save( rangeConditionRepository diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/RangeTriggerController.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/RangeTriggerController.java index a86a386..c8c5589 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/RangeTriggerController.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/controller/RangeTriggerController.java @@ -1,6 +1,6 @@ package ch.usi.inf.sa4.sanmarinoes.smarthut.controller; -import ch.usi.inf.sa4.sanmarinoes.smarthut.dto.RangeTriggerSaveRequest; +import ch.usi.inf.sa4.sanmarinoes.smarthut.dto.RangeConditionOrTriggerSaveRequest; import ch.usi.inf.sa4.sanmarinoes.smarthut.error.NotFoundException; import ch.usi.inf.sa4.sanmarinoes.smarthut.models.RangeTrigger; import ch.usi.inf.sa4.sanmarinoes.smarthut.models.RangeTriggerRepository; @@ -29,7 +29,7 @@ public class RangeTriggerController { return rangeTriggerRepository.findAllByAutomationId(automationId); } - private RangeTrigger save(RangeTrigger newRL, RangeTriggerSaveRequest s) { + private RangeTrigger save(RangeTrigger newRL, RangeConditionOrTriggerSaveRequest s) { newRL.setDeviceId(s.getDeviceId()); newRL.setAutomationId(s.getAutomationId()); newRL.setOperator(s.getOperator()); @@ -40,13 +40,13 @@ public class RangeTriggerController { @PostMapping public RangeTrigger create( - @Valid @RequestBody RangeTriggerSaveRequest booleanTriggerSaveRequest) { + @Valid @RequestBody RangeConditionOrTriggerSaveRequest booleanTriggerSaveRequest) { return save(new RangeTrigger(), booleanTriggerSaveRequest); } @PutMapping public RangeTrigger update( - @Valid @RequestBody RangeTriggerSaveRequest booleanTriggerSaveRequest) + @Valid @RequestBody RangeConditionOrTriggerSaveRequest booleanTriggerSaveRequest) throws NotFoundException { return save( rangeTriggerRepository diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/dto/BooleanTriggerSaveRequest.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/dto/BooleanConditionOrTriggerSaveRequest.java similarity index 82% rename from src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/dto/BooleanTriggerSaveRequest.java rename to src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/dto/BooleanConditionOrTriggerSaveRequest.java index 8f57b22..de5b4c6 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/dto/BooleanTriggerSaveRequest.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/dto/BooleanConditionOrTriggerSaveRequest.java @@ -4,7 +4,7 @@ import javax.validation.constraints.NotNull; import lombok.Data; @Data -public class BooleanTriggerSaveRequest { +public class BooleanConditionOrTriggerSaveRequest { private long id; diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/dto/BooleanConditionSaveRequest.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/dto/BooleanConditionSaveRequest.java deleted file mode 100644 index 2abf6e0..0000000 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/dto/BooleanConditionSaveRequest.java +++ /dev/null @@ -1,42 +0,0 @@ -package ch.usi.inf.sa4.sanmarinoes.smarthut.dto; - -import javax.validation.constraints.NotNull; - -public class BooleanConditionSaveRequest { - - @NotNull private long id; - - @NotNull private Long deviceId; - - @NotNull private Long automationId; - - @NotNull private boolean on; - - public long getId() { - return id; - } - - public Long getDeviceId() { - return deviceId; - } - - public void setDeviceId(Long deviceId) { - this.deviceId = deviceId; - } - - public Long getAutomationId() { - return automationId; - } - - public void setAutomationId(Long automationId) { - this.automationId = automationId; - } - - public boolean isOn() { - return on; - } - - public void setOn(boolean on) { - this.on = on; - } -} diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/dto/RangeTriggerSaveRequest.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/dto/RangeConditionOrTriggerSaveRequest.java similarity index 87% rename from src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/dto/RangeTriggerSaveRequest.java rename to src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/dto/RangeConditionOrTriggerSaveRequest.java index 8c43ce6..a222202 100644 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/dto/RangeTriggerSaveRequest.java +++ b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/dto/RangeConditionOrTriggerSaveRequest.java @@ -5,7 +5,7 @@ import javax.validation.constraints.NotNull; import lombok.Data; @Data -public class RangeTriggerSaveRequest { +public class RangeConditionOrTriggerSaveRequest { private long id; diff --git a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/dto/RangeConditionSaveRequest.java b/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/dto/RangeConditionSaveRequest.java deleted file mode 100644 index 65fb3e4..0000000 --- a/src/main/java/ch/usi/inf/sa4/sanmarinoes/smarthut/dto/RangeConditionSaveRequest.java +++ /dev/null @@ -1,19 +0,0 @@ -package ch.usi.inf.sa4.sanmarinoes.smarthut.dto; - -import ch.usi.inf.sa4.sanmarinoes.smarthut.models.Operator; -import javax.validation.constraints.NotNull; -import lombok.Data; - -@Data -public class RangeConditionSaveRequest { - - @NotNull private long id; - - @NotNull private Long deviceId; - - @NotNull private Long automationId; - - @NotNull private Operator operator; - - @NotNull private double range; -}