forked from upstream-mirrors/OpenTracks
@@ -2,7 +2,7 @@ package de.dennisguse.opentracks.data.models;
|
||||
|
||||
import java.util.Objects;
|
||||
|
||||
public class AtmosphericPressure {
|
||||
public record AtmosphericPressure(float value) {
|
||||
|
||||
public static AtmosphericPressure ofPA(float value_Pa) {
|
||||
return new AtmosphericPressure(value_Pa * 100);
|
||||
@@ -12,12 +12,6 @@ public class AtmosphericPressure {
|
||||
return new AtmosphericPressure(value_hPa);
|
||||
}
|
||||
|
||||
private final float value;
|
||||
|
||||
private AtmosphericPressure(float value) {
|
||||
this.value = value;
|
||||
}
|
||||
|
||||
public float getPA() {
|
||||
return value * 100;
|
||||
}
|
||||
@@ -25,24 +19,4 @@ public class AtmosphericPressure {
|
||||
public float getHPA() {
|
||||
return value;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) return true;
|
||||
if (o == null || getClass() != o.getClass()) return false;
|
||||
AtmosphericPressure that = (AtmosphericPressure) o;
|
||||
return Float.compare(that.value, value) == 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int hashCode() {
|
||||
return Objects.hash(value);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "AtmosphericPressure{" +
|
||||
"value=" + value +
|
||||
'}';
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user