# TravelEstimate

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

*** ** * ** ***

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

<br />

```
@CarProtocol
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                                                                                                                             |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `class `[TravelEstimate.Builder](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/TravelEstimate.Builder) A builder of[TravelEstimate](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/TravelEstimate). |

|                                     ### Constants                                     |
|---------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| `const `[Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html) | [REMAINING_TIME_UNKNOWN](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/TravelEstimate#REMAINING_TIME_UNKNOWN())` = -1` A value used to represent an unknown remaining amount of time. |

|                                             ### Public functions                                              |
|---------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| [Boolean](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-boolean/index.html)                           | [equals](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/TravelEstimate#equals(java.lang.Object))`(other: `[Any](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-any/index.html)`?)`                                                                                              |
| [DateTimeWithZone](https://developer.android.com/reference/kotlin/androidx/car/app/model/DateTimeWithZone)`?` | [getArrivalTimeAtDestination](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/TravelEstimate#getArrivalTimeAtDestination())`()` Returns the arrival time until at the destination or`null`if not set.                                                                                   |
| [Distance](https://developer.android.com/reference/kotlin/androidx/car/app/model/Distance)`?`                 | [getRemainingDistance](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/TravelEstimate#getRemainingDistance())`()` Returns the remaining[Distance](https://developer.android.com/reference/kotlin/androidx/car/app/model/Distance)until arriving at the destination, or`null`if not set. |
| [CarColor](https://developer.android.com/reference/kotlin/androidx/car/app/model/CarColor)`?`                 | [getRemainingDistanceColor](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/TravelEstimate#getRemainingDistanceColor())`()` Returns the color of the remaining distance text or`null`if not set.                                                                                        |
| [CarColor](https://developer.android.com/reference/kotlin/androidx/car/app/model/CarColor)`?`                 | [getRemainingTimeColor](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/TravelEstimate#getRemainingTimeColor())`()` Returns the color of the remaining time text or`null`if not set.                                                                                                    |
| [Long](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-long/index.html)                                 | [getRemainingTimeSeconds](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/TravelEstimate#getRemainingTimeSeconds())`()` Returns the remaining time until arriving at the destination, in seconds.                                                                                       |
| [CarIcon](https://developer.android.com/reference/kotlin/androidx/car/app/model/CarIcon)`?`                   | `@`[RequiresCarApi](https://developer.android.com/reference/kotlin/androidx/car/app/annotations/RequiresCarApi)`(value = 5)` [getTripIcon](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/TravelEstimate#getTripIcon())`()` Returns the trip icon or`null`if not set.                  |
| [CarText](https://developer.android.com/reference/kotlin/androidx/car/app/model/CarText)`?`                   | `@`[RequiresCarApi](https://developer.android.com/reference/kotlin/androidx/car/app/annotations/RequiresCarApi)`(value = 5)` [getTripText](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/TravelEstimate#getTripText())`()` Returns the trip text or`null`if not set.                  |
| [Int](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-int/index.html)                                   | [hashCode](https://developer.android.com/reference/kotlin/androidx/car/app/navigation/model/TravelEstimate#hashCode())`()`                                                                                                                                                                                               |
| [String](https://kotlinlang.org/api/core/kotlin-stdlib/kotlin/-string/index.html)                             | [toString](https://developer.android.com/reference/kotlin/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)  

```
const val REMAINING_TIME_UNKNOWN = -1: Long
```

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

## Public functions

### equals

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

### getArrivalTimeAtDestination

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

```
fun getArrivalTimeAtDestination(): DateTimeWithZone?
```

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

|                                                                                              See also                                                                                               |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [Builder](https://developer.android.com/reference/kotlin/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)  

```
fun getRemainingDistance(): Distance?
```

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

|                                                                                              See also                                                                                               |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [Builder](https://developer.android.com/reference/kotlin/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)  

```
fun getRemainingDistanceColor(): CarColor?
```

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

|                                                                                            See also                                                                                             |
|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [setRemainingDistanceColor](https://developer.android.com/reference/kotlin/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)  

```
fun getRemainingTimeColor(): CarColor?
```

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

|                                                                                        See also                                                                                         |
|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [setRemainingTimeColor](https://developer.android.com/reference/kotlin/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)  

```
fun getRemainingTimeSeconds(): Long
```

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

|                                                                             See also                                                                             |
|------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [setRemainingTimeSeconds](https://developer.android.com/reference/kotlin/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)
fun getTripIcon(): CarIcon?
```

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

|                                                                              See also                                                                              |
|--------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|
| [setTripIcon](https://developer.android.com/reference/kotlin/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)
fun getTripText(): CarText?
```

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

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

### hashCode

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

### toString

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