Speed


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


Information about the current car speed.

Summary

Nested types

public final class Speed.Builder

A builder of Speed.

Public methods

boolean
@NonNull CarValue<Float>

Returns the display speed of the car in meters/second.

@NonNull CarValue<Float>

Returns the raw speed of the car in meters/second.

@NonNull CarValue<Integer>

Returns the units used to display speed from the car settings.

int
@NonNull String

Public methods

equals

public boolean equals(@Nullable Object other)

getDisplaySpeedMetersPerSecond

Added in 1.1.0
public @NonNull CarValue<FloatgetDisplaySpeedMetersPerSecond()

Returns the display speed of the car in meters/second.

This is the value expected to be displayed on the speedometer.

Some cars may display a slightly higher speed than the actual speed.

The value is positive when the vehicle is moving forward, negative when moving backwards, and zero when stopped.

getRawSpeedMetersPerSecond

Added in 1.1.0
public @NonNull CarValue<FloatgetRawSpeedMetersPerSecond()

Returns the raw speed of the car in meters/second.

The value is positive when the vehicle is moving forward, negative when moving backwards and zero when stopped.

getSpeedDisplayUnit

Added in 1.1.0
public @NonNull CarValue<IntegergetSpeedDisplayUnit()

Returns the units used to display speed from the car settings.

See CarUnit for valid speed units.

hashCode

public int hashCode()

toString

public @NonNull String toString()