Skip to content
Snippets Groups Projects
Commit 9e7a745e authored by Sören Henning's avatar Sören Henning
Browse files

Add hashCode and equals method

parent a2bf972b
No related branches found
No related tags found
No related merge requests found
This commit is part of merge request !11. Comments created here will be created in the context of that merge request.
package theodolite.uc4.streamprocessing; package theodolite.uc4.streamprocessing;
import java.util.Objects;
/** /**
* Composed key of an hour of the day and a sensor id. * Composed key of an hour of the day and a sensor id.
*/ */
...@@ -26,4 +28,22 @@ public class HourOfDayKey { ...@@ -26,4 +28,22 @@ public class HourOfDayKey {
return this.sensorId + ";" + this.hourOfDay; 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;
}
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment