Mileage
@CarProtocol
@RequiresCarApi(value = 3)
public final class Mileage
Information about car mileage.
Summary
Nested types |
|---|
public final class Mileage.BuilderA builder of |
Public methods |
|
|---|---|
boolean |
|
@NonNull CarValue<Integer> |
Returns the distance display unit from the car hardware. |
@NonNull CarValue<Float> |
Returns the value of the odometer from the car hardware in kilometers. |
@NonNull CarValue<Float> |
This method is deprecated. use |
int |
hashCode() |
@NonNull String |
toString() |
Public methods
getDistanceDisplayUnit
public @NonNull CarValue<Integer> getDistanceDisplayUnit()
Returns the distance display unit from the car hardware.
See CarUnit for possible distance values.
getOdometerInKilometers
public @NonNull CarValue<Float> getOdometerInKilometers()
Returns the value of the odometer from the car hardware in kilometers. The precision of this value depends on the hardware implementation. Some vehicles may return whole kilomters, while others may return down to tenths or hundredths of a kilometer.
getOdometerMeters
public @NonNull CarValue<Float>getOdometerMeters()
Returns the value of the odometer from the car hardware in KILOMETERS. Despite the name "meters", this method actually returns the odometer in kilometers. It was incorrectly introduced as meters and due to backwards compatibility concerns, can no longer be renamed or removed.