# 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)

*** ** * ** ***


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

<br />

*** ** * ** ***

Information about toll card capabilities in a car.

## Summary

| ### Nested types |
|---|
| `public final class https://developer.android.com/reference/androidx/car/app/hardware/info/TollCard.Builder` A builder of `https://developer.android.com/reference/androidx/car/app/hardware/info/TollCard`. |

| ### Constants |
|---|---|
| `static final int` | `https://developer.android.com/reference/androidx/car/app/hardware/info/TollCard#TOLLCARD_STATE_INVALID() = 2` Toll card state invalid. |
| `static final int` | `https://developer.android.com/reference/androidx/car/app/hardware/info/TollCard#TOLLCARD_STATE_NOT_INSERTED() = 3` Toll card state is not inserted. |
| `static final int` | `https://developer.android.com/reference/androidx/car/app/hardware/info/TollCard#TOLLCARD_STATE_UNKNOWN() = 0` Toll card state is unknown. |
| `static final int` | `https://developer.android.com/reference/androidx/car/app/hardware/info/TollCard#TOLLCARD_STATE_VALID() = 1` Toll card state is valid. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/car/app/hardware/info/TollCard#equals(java.lang.Object)(@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/java/lang/Object.html other)` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/androidx/car/app/hardware/common/CarValue<https://developer.android.com/reference/java/lang/Integer.html>` | `https://developer.android.com/reference/androidx/car/app/hardware/info/TollCard#getCardState()()` Returns the toll card state if available. |
| `int` | `https://developer.android.com/reference/androidx/car/app/hardware/info/TollCard#hashCode()()` |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/lang/String.html` | `https://developer.android.com/reference/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)

```
public static final int TOLLCARD_STATE_INVALID = 2
```

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)

```
public static final int TOLLCARD_STATE_NOT_INSERTED = 3
```

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)

```
public static final int TOLLCARD_STATE_UNKNOWN = 0
```

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)

```
public static final int TOLLCARD_STATE_VALID = 1
```

Toll card state is valid.

## Public methods

### equals

```
public boolean equals(@Nullable Object other)
```

### getCardState

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

```
public @NonNull CarValue<Integer> getCardState()
```

Returns the toll card state if available.

### hashCode

```
public int hashCode()
```

### toString

```
public @NonNull String toString()
```