# CarPropertyValue

Summary:[Constants](https://developer.android.com/reference/android/car/hardware/CarPropertyValue#constants)\|[Inherited Constants](https://developer.android.com/reference/android/car/hardware/CarPropertyValue#inhconstants)\|[Fields](https://developer.android.com/reference/android/car/hardware/CarPropertyValue#lfields)\|[Methods](https://developer.android.com/reference/android/car/hardware/CarPropertyValue#pubmethods)\|[Inherited Methods](https://developer.android.com/reference/android/car/hardware/CarPropertyValue#inhmethods)  

# CarPropertyValue

`
public

final

class
CarPropertyValue
`  
`

extends Object


``


implements

Parcelable


`

|---|--------------------------------------------|
| java.lang.Object                              ||
| ↳ | android.car.hardware.CarPropertyValue\<T\> |

<br />

*** ** * ** ***

Stores a value for a vehicle property ID and area ID combination. Client should use`android.car.*`types when dealing with property ID, area ID or property value and MUST NOT use`android.hardware.automotive.vehicle.*`types directly.

## Summary

|                                                                          ### Constants                                                                          ||
|-------|----------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | [STATUS_AVAILABLE](https://developer.android.com/reference/android/car/hardware/CarPropertyValue#STATUS_AVAILABLE) `CarPropertyValue`is available.       |
| `int` | [STATUS_ERROR](https://developer.android.com/reference/android/car/hardware/CarPropertyValue#STATUS_ERROR) `CarPropertyValue`has an error.               |
| `int` | [STATUS_UNAVAILABLE](https://developer.android.com/reference/android/car/hardware/CarPropertyValue#STATUS_UNAVAILABLE) `CarPropertyValue`is unavailable. |

|                                                                                                                                                                 ### Inherited constants                                                                                                                                                                 |
|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| From interface`android.os.Parcelable` |-------|----------------------------------------| | `int` | `CONTENTS_FILE_DESCRIPTOR` <br />      | | `int` | `PARCELABLE_ELIDE_DUPLICATES` <br />   | | `int` | `PARCELABLE_STABILITY_LOCAL` <br />    | | `int` | `PARCELABLE_STABILITY_VINTF` <br />    | | `int` | `PARCELABLE_WRITE_RETURN_VALUE` <br /> | |

|                                                                                                                   ### Fields                                                                                                                    ||
|----------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------|
| ` public static final Creator<`[CarPropertyValue](https://developer.android.com/reference/android/car/hardware/CarPropertyValue)`<T>>` | [CREATOR](https://developer.android.com/reference/android/car/hardware/CarPropertyValue#CREATOR) <br /> |

|                                                                                                                                     ### Public methods                                                                                                                                      ||
|------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| ` int`     | ` `[describeContents](https://developer.android.com/reference/android/car/hardware/CarPropertyValue#describeContents())`() `                                                                                                                                                    |
| ` boolean` | ` `[equals](https://developer.android.com/reference/android/car/hardware/CarPropertyValue#equals(java.lang.Object))`(Object object) ` Checks equality with passed`object`.                                                                                                      |
| ` int`     | ` `[getAreaId](https://developer.android.com/reference/android/car/hardware/CarPropertyValue#getAreaId())`() ` Returns the area identifier.                                                                                                                                     |
| ` int`     | ` `[getPropertyId](https://developer.android.com/reference/android/car/hardware/CarPropertyValue#getPropertyId())`() ` Returns the property identifier.                                                                                                                         |
| ` int`     | ` `[getPropertyStatus](https://developer.android.com/reference/android/car/hardware/CarPropertyValue#getPropertyStatus())`() `                                                                                                                                                  |
| ` int`     | ` `[getStatus](https://developer.android.com/reference/android/car/hardware/CarPropertyValue#getStatus())`() ` *This method is deprecated. Use[getPropertyStatus()](https://developer.android.com/reference/android/car/hardware/CarPropertyValue#getPropertyStatus())instead.* |
| ` long`    | ` `[getTimestamp](https://developer.android.com/reference/android/car/hardware/CarPropertyValue#getTimestamp())`() ` Returns the timestamp in nanoseconds at which the`CarPropertyValue`happened.                                                                               |
| ` T`       | ` `[getValue](https://developer.android.com/reference/android/car/hardware/CarPropertyValue#getValue())`() ` Returns the value for`CarPropertyValue`.                                                                                                                           |
| ` int`     | ` `[hashCode](https://developer.android.com/reference/android/car/hardware/CarPropertyValue#hashCode())`() ` Generates hash code for this instance.                                                                                                                             |
| ` void`    | ` `[writeToParcel](https://developer.android.com/reference/android/car/hardware/CarPropertyValue#writeToParcel(android.os.Parcel,%20int))`(Parcel dest, int flags) `                                                                                                            |

| ### Inherited methods |
|-----------------------|---|
| From class` java.lang.Object ` |-------------------|-------------------------------| | ` Object`         | ` clone() `                   | | ` boolean`        | ` equals(Object arg0) `       | | ` void`           | ` finalize() `                | | ` final Class<?>` | ` getClass() `                | | ` int`            | ` hashCode() `                | | ` final void`     | ` notify() `                  | | ` final void`     | ` notifyAll() `               | | ` String`         | ` toString() `                | | ` final void`     | ` wait(long arg0, int arg1) ` | | ` final void`     | ` wait(long arg0) `           | | ` final void`     | ` wait() `                    | ||
| From interface` android.os.Parcelable ` |------------------|------------------------------------------| | ` abstract int`  | ` describeContents() `                   | | ` default int`   | ` getStability() `                       | | ` abstract void` | ` writeToParcel(Parcel arg0, int arg1) ` | ||

## Constants

### STATUS_AVAILABLE

```
public static final int STATUS_AVAILABLE
```

`CarPropertyValue`is available.

<br />

Constant Value: 0 (0x00000000)  

### STATUS_ERROR

```
public static final int STATUS_ERROR
```

`CarPropertyValue`has an error.

<br />

Constant Value: 2 (0x00000002)  

### STATUS_UNAVAILABLE

```
public static final int STATUS_UNAVAILABLE
```

`CarPropertyValue`is unavailable.

<br />

Constant Value: 1 (0x00000001)

## Fields

### CREATOR

```
public static final Creator<CarPropertyValue<T>> CREATOR
```

<br />

<br />

## Public methods

### describeContents

```
public int describeContents ()
```

<br />

<br />

|    Returns    ||
|-------|--------|
| `int` | <br /> |

### equals

```
public boolean equals (Object object)
```

Checks equality with passed`object`.

<br />

|        Parameters         ||
|----------|-----------------|
| `object` | `Object` <br /> |

|      Returns      ||
|-----------|--------|
| `boolean` | <br /> |

### getAreaId

```
public int getAreaId ()
```

Returns the area identifier.

<br />

|                                                                                                                                                                                                                                                                                                                        Returns                                                                                                                                                                                                                                                                                                                        ||
|-------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | The area identifier of`CarPropertyValue`, If property is[VehicleAreaType.VEHICLE_AREA_TYPE_GLOBAL](https://developer.android.com/reference/android/car/VehicleAreaType#VEHICLE_AREA_TYPE_GLOBAL), it will be`0`. Otherwise, it will be on or more OR'd together constants of this property's[VehicleAreaType](https://developer.android.com/reference/android/car/VehicleAreaType): - `VehicleAreaWindow` - `VehicleAreaDoor` - [VehicleAreaSeat](https://developer.android.com/reference/android/car/VehicleAreaSeat) - `VehicleAreaMirror` - [VehicleAreaWheel](https://developer.android.com/reference/android/car/VehicleAreaWheel) <br /> |

### getPropertyId

```
public int getPropertyId ()
```

Returns the property identifier.

<br />

|                                                                                                     Returns                                                                                                      ||
|-------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | The property identifier of`CarPropertyValue`. See constants in[VehiclePropertyIds](https://developer.android.com/reference/android/car/VehiclePropertyIds)for some system defined possible values. <br /> |

### getPropertyStatus

```
public int getPropertyStatus ()
```

<br />

<br />

|                                                                                                                                                                                                        Returns                                                                                                                                                                                                        ||
|-------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | The property status of`CarPropertyValue`Value is[STATUS_AVAILABLE](https://developer.android.com/reference/android/car/hardware/CarPropertyValue#STATUS_AVAILABLE),[STATUS_UNAVAILABLE](https://developer.android.com/reference/android/car/hardware/CarPropertyValue#STATUS_UNAVAILABLE), or[STATUS_ERROR](https://developer.android.com/reference/android/car/hardware/CarPropertyValue#STATUS_ERROR) <br /> |

### getStatus

```
public int getStatus ()
```

<br />

**This method is deprecated.**   
Use[getPropertyStatus()](https://developer.android.com/reference/android/car/hardware/CarPropertyValue#getPropertyStatus())instead.

<br />

<br />

|                                                                                                                                                                                                 Returns                                                                                                                                                                                                  ||
|-------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `int` | Status of`CarPropertyValue`Value is[STATUS_AVAILABLE](https://developer.android.com/reference/android/car/hardware/CarPropertyValue#STATUS_AVAILABLE),[STATUS_UNAVAILABLE](https://developer.android.com/reference/android/car/hardware/CarPropertyValue#STATUS_UNAVAILABLE), or[STATUS_ERROR](https://developer.android.com/reference/android/car/hardware/CarPropertyValue#STATUS_ERROR) <br /> |

### getTimestamp

```
public long getTimestamp ()
```

Returns the timestamp in nanoseconds at which the`CarPropertyValue`happened. For a given car property, each new`CarPropertyValue`should be monotonically increasing using the same time base as[SystemClock.elapsedRealtimeNanos()](https://developer.android.com/reference/android/os/SystemClock#elapsedRealtimeNanos()).

NOTE: Timestamp should be synchronized with other signals from the platform (e.g.[Location](https://developer.android.com/reference/android/location/Location)and[SensorEvent](https://developer.android.com/reference/android/hardware/SensorEvent)instances). Ideally, timestamp synchronization error should be below 1 millisecond.

<br />

|    Returns     ||
|--------|--------|
| `long` | <br /> |

### getValue

```
public T getValue ()
```

Returns the value for`CarPropertyValue`.

**Note:** Caller must check the value of[getPropertyStatus()](https://developer.android.com/reference/android/car/hardware/CarPropertyValue#getPropertyStatus()). Only use[getValue()](https://developer.android.com/reference/android/car/hardware/CarPropertyValue#getValue())when[getPropertyStatus()](https://developer.android.com/reference/android/car/hardware/CarPropertyValue#getPropertyStatus())is[STATUS_AVAILABLE](https://developer.android.com/reference/android/car/hardware/CarPropertyValue#STATUS_AVAILABLE). If not,[getValue()](https://developer.android.com/reference/android/car/hardware/CarPropertyValue#getValue())is meaningless.

<br />

|   Returns   ||
|-----|--------|
| `T` | <br /> |

### hashCode

```
public int hashCode ()
```

Generates hash code for this instance.

<br />

|    Returns    ||
|-------|--------|
| `int` | <br /> |

### writeToParcel

```
public void writeToParcel (Parcel dest, 
                int flags)
```

<br />

<br />

|        Parameters        ||
|---------|-----------------|
| `dest`  | `Parcel` <br /> |
| `flags` | `int` <br />    |