CarValue

public final class CarValue
extends Object

java.lang.Object
   ↳ androidx.car.app.hardware.common.CarValue<T>


A data value object returned from car hardware with associated metadata including status, timestamp, and the actual value.

Summary

Constants

int STATUS_SUCCESS

CarValue was obtained successfully.

int STATUS_UNAVAILABLE

CarValue attempted for unavailable property, sensor, or action.

int STATUS_UNIMPLEMENTED

CarValue attempted for unimplemented property, sensor, or action.

int STATUS_UNKNOWN

CarValue has unknown status.

Public constructors

CarValue(T value, long timestampMillis, int status)

Constructs a new instance of a CarValue.

Public methods

boolean equals(Object other)
int getStatus()

Returns the status of this particular result such as success, unavailable, or unimplemented.

long getTimestampMillis()

Returns the time in milliseconds at which the event happened.

T getValue()

Returns a the data value or null if the status is not successful.

int hashCode()
String toString()

Inherited methods