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

Merge branch '54-add-equals-hash-methods-for-serializable-classes' into 'master'

Resolve "Add equals/hash methods for serializable classes"

Closes #54

See merge request !27
parents 9dc72ec7 3c1604f6
No related branches found
No related tags found
No related merge requests found
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.
Finish editing this message first!
Please register or to comment