# TollCard

# TollCard

Artifact:[androidx.car.app:app](https://developer.android.com/jetpack/androidx/releases/car-app)  
[View Source](https://cs.android.com/search?q=file:androidx/car/app/hardware/info/TollCard.java+class:androidx.car.app.hardware.info.TollCard)  
Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)

*** ** * ** ***

Kotlin\|[Java](https://developer.android.com/reference/androidx/car/app/hardware/info/TollCard "View this page in Java")

<br />

```
@CarProtocol
@RequiresCarApi(value = 3)
class TollCard
```

<br />

*** ** * ** ***

Information about toll card capabilities in a car.

## Summary

|                                                                                                              ### Nested types                                                                                                              |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `class `[TollCard.Builder](https://developer.android.com/reference/kotlin/androidx/car/app/hardware/info/TollCard.Builder) A builder of[TollCard](https://developer.android.com/reference/kotlin/androidx/car/app/hardware/info/TollCard). |

|                                    ### Constants                                    |
|-------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [TOLLCARD_STATE_INVALID](https://developer.android.com/reference/kotlin/androidx/car/app/hardware/info/TollCard#TOLLCARD_STATE_INVALID())` = 2` Toll card state invalid.                   |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [TOLLCARD_STATE_NOT_INSERTED](https://developer.android.com/reference/kotlin/androidx/car/app/hardware/info/TollCard#TOLLCARD_STATE_NOT_INSERTED())` = 3` Toll card state is not inserted. |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [TOLLCARD_STATE_UNKNOWN](https://developer.android.com/reference/kotlin/androidx/car/app/hardware/info/TollCard#TOLLCARD_STATE_UNKNOWN())` = 0` Toll card state is unknown.                |
| `const `[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html) | [TOLLCARD_STATE_VALID](https://developer.android.com/reference/kotlin/androidx/car/app/hardware/info/TollCard#TOLLCARD_STATE_VALID())` = 1` Toll card state is valid.                      |

|                                                                                  ### Public functions                                                                                  |
|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                                                                                                    | [equals](https://developer.android.com/reference/kotlin/androidx/car/app/hardware/info/TollCard#equals(java.lang.Object))`(other: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?)` |
| [CarValue](https://developer.android.com/reference/kotlin/androidx/car/app/hardware/common/CarValue)`<`[Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)`!>` | [getCardState](https://developer.android.com/reference/kotlin/androidx/car/app/hardware/info/TollCard#getCardState())`()` Returns the toll card state if available.                                                |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                                                                                            | [hashCode](https://developer.android.com/reference/kotlin/androidx/car/app/hardware/info/TollCard#hashCode())`()`                                                                                                  |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)                                                                                                      | [toString](https://developer.android.com/reference/kotlin/androidx/car/app/hardware/info/TollCard#toString())`()`                                                                                                  |

## Constants

### TOLLCARD_STATE_INVALID

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)  

```
const val TOLLCARD_STATE_INVALID = 2: Int
```

Toll card state invalid.

On some vehicles this may be that the toll card is inserted but not valid while other vehicles might not have a toll card inserted.  

### TOLLCARD_STATE_NOT_INSERTED

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)  

```
const val TOLLCARD_STATE_NOT_INSERTED = 3: Int
```

Toll card state is not inserted.

Will be returned if the car hardware is able to detect that the card is not inserted.  

### TOLLCARD_STATE_UNKNOWN

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)  

```
const val TOLLCARD_STATE_UNKNOWN = 0: Int
```

Toll card state is unknown.  

### TOLLCARD_STATE_VALID

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)  

```
const val TOLLCARD_STATE_VALID = 1: Int
```

Toll card state is valid.  

## Public functions

### equals

```
fun equals(other: Any?): Boolean
```  

### getCardState

Added in[1.1.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.1.0)  

```
fun getCardState(): CarValue<Int!>
```

Returns the toll card state if available.  

### hashCode

```
fun hashCode(): Int
```  

### toString

```
fun toString(): String
```