Implement Track.Id and Waypoint.Id (with tests).

Fixes #276.
This commit is contained in:
Dennis Guse
2020-08-19 18:10:13 +02:00
parent bcbaf4985a
commit 0ab14e0f3d
20 changed files with 124 additions and 58 deletions
@@ -20,6 +20,7 @@ import android.os.Parcel;
import android.os.Parcelable;
import androidx.annotation.NonNull;
import androidx.annotation.Nullable;
import java.util.Objects;
import java.util.UUID;
@@ -49,7 +50,11 @@ public class Track {
public Track() {
}
public Id getId() {
/**
* May be null if the track was not loaded from the database.
*/
public @Nullable
Id getId() {
return id;
}
@@ -122,6 +127,7 @@ public class Track {
return id;
}
@Deprecated //TODO Use a Track.Id of null instead
public boolean isValid() {
return id != PreferencesUtils.RECORDING_TRACK_ID_DEFAULT;
}
@@ -144,6 +150,12 @@ public class Track {
return 0;
}
@NonNull
@Override
public String toString() {
throw new RuntimeException("Not supported");
}
@Override
public void writeToParcel(Parcel parcel, int i) {
parcel.writeLong(id);