Skip to content

Commit

Permalink
Merge pull request #120 from marcinar/master
Browse files Browse the repository at this point in the history
Really allow zero interval + fix integer comparisons
  • Loading branch information
TVolden authored May 20, 2020
2 parents ecaceb4 + 5ff8256 commit 9e8f2c0
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ public Integer getInterval() {
*/
@XmlElement
public void setInterval(Integer interval) {
if (interval <= 0) {
if (interval < 0) {
throw new PropertyConstraintException(interval, "interval be a positive value");
}

Expand Down Expand Up @@ -172,7 +172,7 @@ public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
BootNotificationConfirmation that = (BootNotificationConfirmation) o;
return interval == that.interval
return Objects.equals(interval, that.interval)
&& Objects.equals(currentTime, that.currentTime)
&& status == that.status;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
ChangeAvailabilityRequest that = (ChangeAvailabilityRequest) o;
return connectorId == that.connectorId && type == that.type;
return Objects.equals(connectorId, that.connectorId) && type == that.type;
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -148,8 +148,8 @@ public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
MeterValuesRequest that = (MeterValuesRequest) o;
return connectorId == that.connectorId
&& transactionId == that.transactionId
return Objects.equals(connectorId, that.connectorId)
&& Objects.equals(transactionId, that.transactionId)
&& Arrays.equals(meterValue, that.meterValue);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ public boolean equals(Object o) {
if (this == o) return true;
if (o == null || getClass() != o.getClass()) return false;
GetDiagnosticsRequest that = (GetDiagnosticsRequest) o;
return retries == that.retries
&& retryInterval == that.retryInterval
return Objects.equals(retries, that.retries)
&& Objects.equals(retryInterval, that.retryInterval)
&& Objects.equals(location, that.location)
&& Objects.equals(startTime, that.startTime)
&& Objects.equals(stopTime, that.stopTime);
Expand Down

0 comments on commit 9e8f2c0

Please sign in to comment.