Mileage.Builder

public static final class Mileage.Builder
extends Object

java.lang.Object
   ↳ androidx.car.app.hardware.info.Mileage.Builder


A builder of Mileage.

Summary

Public constructors

Builder()

Public methods

Mileage build()

Constructs the Mileage defined by this builder.

Mileage.Builder setDistanceDisplayUnit(CarValue<Integer> mileageDisplayUnit)

Sets the mileage display unit.

Mileage.Builder setOdometerMeters(CarValue<Float> odometerMeters)

Sets the odometer value in meters.

Inherited methods

Public constructors

Builder

public Builder ()

Public methods

build

public Mileage build ()

Constructs the Mileage defined by this builder.

Returns
Mileage

setDistanceDisplayUnit

public Mileage.Builder setDistanceDisplayUnit (CarValue<Integer> mileageDisplayUnit)

Sets the mileage display unit.

Valid values are in CarUnit.

Parameters
mileageDisplayUnit CarValue

Returns
Mileage.Builder

Throws
NullPointerException if mileageDisplayUnit is null

setOdometerMeters

public Mileage.Builder setOdometerMeters (CarValue<Float> odometerMeters)

Sets the odometer value in meters.

Parameters
odometerMeters CarValue

Returns
Mileage.Builder

Throws
NullPointerException if odometer is null