Cleanup: use Java17 switch statements.

AndroidStudio code cleanup.
This commit is contained in:
Dennis Guse
2023-04-13 14:52:20 +02:00
parent 3a8e547e10
commit efddb31391
30 changed files with 355 additions and 640 deletions
@@ -115,16 +115,11 @@ public class Speed {
}
public double to(UnitSystem unitSystem) {
switch (unitSystem) {
case METRIC:
return toKMH();
case IMPERIAL:
return toMPH();
case NAUTICAL_IMPERIAL:
return toKnots();
default:
throw new RuntimeException("Not implemented");
}
return switch (unitSystem) {
case METRIC -> toKMH();
case IMPERIAL -> toMPH();
case NAUTICAL_IMPERIAL -> toKnots();
};
}
@Override