Mileage


@CarProtocol
@RequiresCarApi(value = 3)
public final class Mileage


Information about car mileage.

Summary

Nested types

public final class Mileage.Builder

A builder of Mileage.

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 getOdometerInKilometers which does the same as this method, except that the correct units are in the API name

int
@NonNull String

Public methods

equals

public boolean equals(@Nullable Object other)

getDistanceDisplayUnit

Added in 1.1.0
public @NonNull CarValue<IntegergetDistanceDisplayUnit()

Returns the distance display unit from the car hardware.

See CarUnit for possible distance values.

getOdometerInKilometers

Added in 1.8.0-alpha01
public @NonNull CarValue<FloatgetOdometerInKilometers()

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

Added in 1.1.0
Deprecated in 1.8.0-alpha01
public @NonNull CarValue<FloatgetOdometerMeters()

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.

hashCode

public int hashCode()

toString

public @NonNull String toString()