From d4ec6c6d58d6e5159504bf3b81ec44a5dde66fd3 Mon Sep 17 00:00:00 2001 From: Armin Date: Wed, 27 Sep 2023 12:20:41 +0200 Subject: [PATCH] Add equals to RawRecord --- libs/model/src/main/java/de/cyface/model/RawRecord.java | 9 +++++++++ .../src/main/kotlin/de/cyface/model/CalibrationJob.kt | 4 ---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/libs/model/src/main/java/de/cyface/model/RawRecord.java b/libs/model/src/main/java/de/cyface/model/RawRecord.java index e39a57f..29c8830 100644 --- a/libs/model/src/main/java/de/cyface/model/RawRecord.java +++ b/libs/model/src/main/java/de/cyface/model/RawRecord.java @@ -142,4 +142,13 @@ public void setSpeed(double speed) { public void setModality(Modality modality) { this.modality = modality; } + + @Override + public boolean equals(Object o) { + if (this == o) return true; + if (o == null || getClass() != o.getClass()) return false; + if (!super.equals(o)) return false; + RawRecord rawRecord = (RawRecord) o; + return Double.compare(rawRecord.accuracy, accuracy) == 0 && Double.compare(rawRecord.speed, speed) == 0 && modality == rawRecord.modality; + } } diff --git a/libs/model/src/main/kotlin/de/cyface/model/CalibrationJob.kt b/libs/model/src/main/kotlin/de/cyface/model/CalibrationJob.kt index fd2c679..97e0e5d 100644 --- a/libs/model/src/main/kotlin/de/cyface/model/CalibrationJob.kt +++ b/libs/model/src/main/kotlin/de/cyface/model/CalibrationJob.kt @@ -34,7 +34,6 @@ class CalibrationJob : Job { */ @Suppress("MemberVisibilityCanBePrivate") // Part of the API var isProcessable: Boolean - private set /** * The number of locations to be processed for this job. @@ -47,21 +46,18 @@ class CalibrationJob : Job { */ @Suppress("MemberVisibilityCanBePrivate") // Part of the API var rotatedLocations = 0 - private set /** * The number of locations which where filtered due to invalid speed, accuracy or time gaps. */ @Suppress("MemberVisibilityCanBePrivate") // Part of the API var invalidLocations = 0 - private set /** * The number of locations which were filtered during interpolation. */ @Suppress("MemberVisibilityCanBePrivate") // Part of the API var nonInterpolatableLocations = 0 - private set /** * Constructs a fully initialized instance of this class.