# TravelEstimate

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/navigation/model/TravelEstimate.java+class:androidx.car.app.navigation.model.TravelEstimate) Added in [1.0.0](https://developer.android.com/jetpack/androidx/releases/car-app#1.0.0)

*** ** * ** ***


```
@CarProtocol
public final class TravelEstimate
```

<br />

*** ** * ** ***

Represents the travel estimates to a destination of a trip or for a trip segment, including the remaining time and distance to the destination.

## Summary

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

| ### Constants |
|---|---|
| `static final long` | `https://developer.android.com/reference/androidx/car/app/navigation/model/TravelEstimate#REMAINING_TIME_UNKNOWN() = -1` A value used to represent an unknown remaining amount of time. |

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/car/app/navigation/model/TravelEstimate#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/Nullable.html https://developer.android.com/reference/androidx/car/app/model/DateTimeWithZone` | `https://developer.android.com/reference/androidx/car/app/navigation/model/TravelEstimate#getArrivalTimeAtDestination()()` Returns the arrival time until at the destination or `null` if not set. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/Distance` | `https://developer.android.com/reference/androidx/car/app/navigation/model/TravelEstimate#getRemainingDistance()()` Returns the remaining `https://developer.android.com/reference/androidx/car/app/model/Distance` until arriving at the destination, or `null` if not set. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/CarColor` | `https://developer.android.com/reference/androidx/car/app/navigation/model/TravelEstimate#getRemainingDistanceColor()()` Returns the color of the remaining distance text or `null` if not set. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/CarColor` | `https://developer.android.com/reference/androidx/car/app/navigation/model/TravelEstimate#getRemainingTimeColor()()` Returns the color of the remaining time text or `null` if not set. |
| `long` | `https://developer.android.com/reference/androidx/car/app/navigation/model/TravelEstimate#getRemainingTimeSeconds()()` Returns the remaining time until arriving at the destination, in seconds. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/CarIcon` | `@https://developer.android.com/reference/androidx/car/app/annotations/RequiresCarApi(value = 5) https://developer.android.com/reference/androidx/car/app/navigation/model/TravelEstimate#getTripIcon()()` Returns the trip icon or `null` if not set. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/Nullable.html https://developer.android.com/reference/androidx/car/app/model/CarText` | `@https://developer.android.com/reference/androidx/car/app/annotations/RequiresCarApi(value = 5) https://developer.android.com/reference/androidx/car/app/navigation/model/TravelEstimate#getTripText()()` Returns the trip text or `null` if not set. |
| `int` | `https://developer.android.com/reference/androidx/car/app/navigation/model/TravelEstimate#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/navigation/model/TravelEstimate#toString()()` |

## Constants

### REMAINING_TIME_UNKNOWN

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

```
public static final long REMAINING_TIME_UNKNOWN = -1
```

A value used to represent an unknown remaining amount of time.

## Public methods

### equals

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

### getArrivalTimeAtDestination

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

```
public @Nullable DateTimeWithZone getArrivalTimeAtDestination()
```

Returns the arrival time until at the destination or `null` if not set.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/navigation/model/TravelEstimate.Builder#Builder(androidx.car.app.model.Distance,androidx.car.app.model.DateTimeWithZone)` |   |

### getRemainingDistance

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

```
public @Nullable Distance getRemainingDistance()
```

Returns the remaining `https://developer.android.com/reference/androidx/car/app/model/Distance` until arriving at the destination, or `null` if not set.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/navigation/model/TravelEstimate.Builder#Builder(androidx.car.app.model.Distance,androidx.car.app.model.DateTimeWithZone)` |   |

### getRemainingDistanceColor

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

```
public @Nullable CarColor getRemainingDistanceColor()
```

Returns the color of the remaining distance text or `null` if not set.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/navigation/model/TravelEstimate.Builder#setRemainingDistanceColor(androidx.car.app.model.CarColor)` |   |

### getRemainingTimeColor

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

```
public @Nullable CarColor getRemainingTimeColor()
```

Returns the color of the remaining time text or `null` if not set.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/navigation/model/TravelEstimate.Builder#setRemainingTimeColor(androidx.car.app.model.CarColor)` |   |

### getRemainingTimeSeconds

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

```
public long getRemainingTimeSeconds()
```

Returns the remaining time until arriving at the destination, in seconds.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/navigation/model/TravelEstimate.Builder#setRemainingTimeSeconds(long)` |   |

### getTripIcon

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

```
@RequiresCarApi(value = 5)
public @Nullable CarIcon getTripIcon()
```

Returns the trip icon or `null` if not set.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/navigation/model/TravelEstimate.Builder#setTripIcon(androidx.car.app.model.CarIcon)` |   |

### getTripText

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

```
@RequiresCarApi(value = 5)
public @Nullable CarText getTripText()
```

Returns the trip text or `null` if not set.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/navigation/model/TravelEstimate.Builder#setTripText(androidx.car.app.model.CarText)` |   |

### hashCode

```
public int hashCode()
```

### toString

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