forked from upstream-mirrors/OpenTracks
Cleanup.
This commit is contained in:
@@ -7,7 +7,7 @@ import de.dennisguse.opentracks.settings.UnitSystem;
|
||||
|
||||
public record Distance(double distance_m) {
|
||||
|
||||
public static Distance ZERO = Distance.of(0);
|
||||
public static final Distance ZERO = Distance.of(0);
|
||||
|
||||
public static Distance of(double distance_m) {
|
||||
return new Distance(distance_m);
|
||||
|
||||
@@ -6,7 +6,7 @@ import de.dennisguse.opentracks.settings.UnitSystem;
|
||||
|
||||
public record Speed(double speed_mps) {
|
||||
|
||||
public static Speed ZERO = Speed.of(0);
|
||||
public static final Speed ZERO = Speed.of(0);
|
||||
|
||||
public static Speed of(Distance distance, Duration duration) {
|
||||
if (duration.isZero()) {
|
||||
@@ -20,11 +20,6 @@ public record Speed(double speed_mps) {
|
||||
return new Speed(speed_mps);
|
||||
}
|
||||
|
||||
@Deprecated //TODO Remove
|
||||
public static Speed of(String speed_mps) {
|
||||
return of(Float.parseFloat(speed_mps));
|
||||
}
|
||||
|
||||
public static Speed ofKMH(double speed_kmh) {
|
||||
return of(Distance.ofKilometer(speed_kmh), Duration.ofHours(1));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user