diff --git a/uc4-application/src/main/java/theodolite/uc4/streamprocessing/HourOfDayKey.java b/uc4-application/src/main/java/theodolite/uc4/streamprocessing/HourOfDayKey.java index 214be2dd073e21944ec0765eb30ed72a81b15b1b..97807e3bdecf4000cc2edeed364b8f9d1bc9bb8e 100644 --- a/uc4-application/src/main/java/theodolite/uc4/streamprocessing/HourOfDayKey.java +++ b/uc4-application/src/main/java/theodolite/uc4/streamprocessing/HourOfDayKey.java @@ -1,5 +1,7 @@ package theodolite.uc4.streamprocessing; +import java.util.Objects; + /** * Composed key of an hour of the day and a sensor id. */ @@ -26,4 +28,22 @@ public class HourOfDayKey { return this.sensorId + ";" + this.hourOfDay; } + @Override + public int hashCode() { + return Objects.hash(this.hourOfDay, this.sensorId); + } + + @Override + public boolean equals(final Object obj) { + if (obj == this) { + return true; + } + if (obj instanceof HourOfDayKey) { + final HourOfDayKey other = (HourOfDayKey) obj; + return Objects.equals(this.hourOfDay, other.hourOfDay) + && Objects.equals(this.sensorId, other.sensorId); + } + return false; + } + }