# Trip

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

*** ** * ** ***


```
@CarProtocol
public final class Trip
```

<br />

*** ** * ** ***

Represents information about a trip including destinations, steps, and travel estimates.

This information data **may** be displayed in different places in the car such as the instrument cluster screens, heads-up display and floating navigation bar.

Floating navigation bar can show current navigating info in three templates including `https://developer.android.com/reference/androidx/car/app/navigation/model/MapTemplate`, `https://developer.android.com/reference/androidx/car/app/navigation/model/RoutePreviewNavigationTemplate` and `https://developer.android.com/reference/androidx/car/app/navigation/model/PlaceListNavigationTemplate`. The navigating steps can be added with the use of `https://developer.android.com/reference/androidx/car/app/navigation/model/Trip.Builder#addStep(androidx.car.app.navigation.model.Step,androidx.car.app.navigation.model.TravelEstimate)`. There are three navigation info showing in the floating nav bar including:

- The current road description get from `https://developer.android.com/reference/androidx/car/app/navigation/model/Step#getCue()` of the current `https://developer.android.com/reference/androidx/car/app/navigation/model/Step`, which gets from the first element of `https://developer.android.com/reference/androidx/car/app/navigation/model/Trip#getSteps()`
- The remaining distance of the current road get from `https://developer.android.com/reference/androidx/car/app/navigation/model/TravelEstimate#getRemainingDistance()` of the first element of `https://developer.android.com/reference/androidx/car/app/navigation/model/Trip#getStepTravelEstimates()`
- The turn icon get from `https://developer.android.com/reference/androidx/car/app/navigation/model/Maneuver#getIcon()` from the `https://developer.android.com/reference/androidx/car/app/navigation/model/Maneuver` of the current `https://developer.android.com/reference/androidx/car/app/navigation/model/Step`

## Summary

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

| ### Public methods |
|---|---|
| `boolean` | `https://developer.android.com/reference/androidx/car/app/navigation/model/Trip#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/CarText` | `https://developer.android.com/reference/androidx/car/app/navigation/model/Trip#getCurrentRoad()()` Returns the text that describes the current road. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/car/app/navigation/model/TravelEstimate>` | `https://developer.android.com/reference/androidx/car/app/navigation/model/Trip#getDestinationTravelEstimates()()` Returns the list of `https://developer.android.com/reference/androidx/car/app/navigation/model/TravelEstimate`s for the `https://developer.android.com/reference/androidx/car/app/navigation/model/Destination`s in the trip. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/car/app/navigation/model/Destination>` | `https://developer.android.com/reference/androidx/car/app/navigation/model/Trip#getDestinations()()` Returns the list of destinations for this trip. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/car/app/navigation/model/TravelEstimate>` | `https://developer.android.com/reference/androidx/car/app/navigation/model/Trip#getStepTravelEstimates()()` Returns the list of `https://developer.android.com/reference/androidx/car/app/navigation/model/TravelEstimate`s for the `https://developer.android.com/reference/androidx/car/app/navigation/model/Step`s in the trip. |
| `@https://jspecify.dev/docs/api/org/jspecify/annotations/NonNull.html https://developer.android.com/reference/java/util/List.html<https://developer.android.com/reference/androidx/car/app/navigation/model/Step>` | `https://developer.android.com/reference/androidx/car/app/navigation/model/Trip#getSteps()()` Returns the list of steps for the trip. |
| `int` | `https://developer.android.com/reference/androidx/car/app/navigation/model/Trip#hashCode()()` |
| `boolean` | `https://developer.android.com/reference/androidx/car/app/navigation/model/Trip#isLoading()()` Returns whether the trip is in a loading state. |
| `@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/Trip#toString()()` |

## Public methods

### equals

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

### getCurrentRoad

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

```
public @Nullable CarText getCurrentRoad()
```

Returns the text that describes the current road.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/navigation/model/Trip.Builder#setCurrentRoad(java.lang.CharSequence)` |   |

### getDestinationTravelEstimates

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

```
public @NonNull List<TravelEstimate> getDestinationTravelEstimates()
```

Returns the list of `https://developer.android.com/reference/androidx/car/app/navigation/model/TravelEstimate`s for the `https://developer.android.com/reference/androidx/car/app/navigation/model/Destination`s in the trip.

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

### getDestinations

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

```
public @NonNull List<Destination> getDestinations()
```

Returns the list of destinations for this trip.

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

### getStepTravelEstimates

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

```
public @NonNull List<TravelEstimate> getStepTravelEstimates()
```

Returns the list of `https://developer.android.com/reference/androidx/car/app/navigation/model/TravelEstimate`s for the `https://developer.android.com/reference/androidx/car/app/navigation/model/Step`s in the trip.

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

### getSteps

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

```
public @NonNull List<Step> getSteps()
```

Returns the list of steps for the trip.

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

### hashCode

```
public int hashCode()
```

### isLoading

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

```
public boolean isLoading()
```

Returns whether the trip is in a loading state.

| See also |
|---|---|
| `https://developer.android.com/reference/androidx/car/app/navigation/model/Trip.Builder#setLoading(boolean)` |   |

### toString

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