Waypoint requires a non-null location.

Remove setLocation() from Waypoint and TrackPoint.
This commit is contained in:
Dennis Guse
2020-03-29 22:56:11 +02:00
parent a98c16de28
commit 364b4702e3
7 changed files with 36 additions and 44 deletions
@@ -20,6 +20,7 @@ import android.location.Location;
import android.net.Uri;
import androidx.annotation.NonNull;
import androidx.annotation.VisibleForTesting;
/**
* A waypoint.
@@ -40,10 +41,15 @@ public final class Waypoint {
private Location location = null;
private String photoUrl = "";
@VisibleForTesting
public Waypoint() {
}
public Waypoint(String name, String description, String category, String icon, long trackId, double length, long duration, Location location, String photoUrl) {
public Waypoint(Location location) {
this.location = location;
}
public Waypoint(String name, String description, String category, String icon, long trackId, double length, long duration, @NonNull Location location, String photoUrl) {
this.name = name;
this.description = description;
this.category = category;
@@ -124,10 +130,6 @@ public final class Waypoint {
return location;
}
public void setLocation(@NonNull Location location) {
this.location = location;
}
public String getPhotoUrl() {
return photoUrl;
}