Speed.Builder

public static final class Speed.Builder
extends Object

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


A builder of Speed.

Summary

Public constructors

Builder()

Public methods

Speed build()

Constructs the Speed defined by this builder.

Speed.Builder setDisplaySpeedMetersPerSecond(CarValue<Float> displaySpeedMetersPerSecond)

Sets the display speed in meters per second.

Speed.Builder setRawSpeedMetersPerSecond(CarValue<Float> rawSpeedMetersPerSecond)

Sets the raw speed in meters per second.

Speed.Builder setSpeedDisplayUnit(CarValue<Integer> speedDisplayUnit)

Sets the units used to display speed from the car hardware settings.

Inherited methods

Public constructors

Builder

public Builder ()

Public methods

build

public Speed build ()

Constructs the Speed defined by this builder.

Returns
Speed

setDisplaySpeedMetersPerSecond

public Speed.Builder setDisplaySpeedMetersPerSecond (CarValue<Float> displaySpeedMetersPerSecond)

Sets the display speed in meters per second. *

Parameters
displaySpeedMetersPerSecond CarValue

Returns
Speed.Builder

Throws
NullPointerException if displaySpeedMetersPerSecond is null

setRawSpeedMetersPerSecond

public Speed.Builder setRawSpeedMetersPerSecond (CarValue<Float> rawSpeedMetersPerSecond)

Sets the raw speed in meters per second.

Parameters
rawSpeedMetersPerSecond CarValue

Returns
Speed.Builder

Throws
NullPointerException if rawSpeedMetersPerSecond is null

setSpeedDisplayUnit

public Speed.Builder setSpeedDisplayUnit (CarValue<Integer> speedDisplayUnit)

Sets the units used to display speed from the car hardware settings.

See CarUnit for valid speed units.

Parameters
speedDisplayUnit CarValue

Returns
Speed.Builder

Throws
NullPointerException if speedDisplayUnit is null