Google is committed to advancing racial equity for Black communities. See how.

TripController

public class TripController
extends Object

java.lang.Object
   ↳ com.google.android.libraries.car.app.testing.navigation.model.TripController


A controller that allows testing of a Trip.

this controller allows retrieving the following fields:

Summary

Public methods

String getCurrentRoad()

Retrieves the current road set in the Trip being controlled, or null if none is present.

List<TravelEstimate> getDestinationTravelEstimates()

Returns a list of TravelEstimates added via Trip.Builder.addDestinationTravelEstimate(TravelEstimate).

List<DestinationController> getDestinations()

Returns a list of DestinationControllers, each containing a Destination added via Trip.Builder.addDestination(Destination).

List<TravelEstimate> getStepTravelEstimates()

Returns a list of TravelEstimates added via Trip.Builder.addStepTravelEstimate(TravelEstimate).

List<StepController> getSteps()

Returns a list of StepControllers, each containing a Step added via Trip.Builder.addStep(Step).

boolean isLoading()
static TripController of(Trip trip)

Creates a TripController to control a Trip for testing.

Inherited methods

Public methods

getCurrentRoad

public String getCurrentRoad ()

Retrieves the current road set in the Trip being controlled, or null if none is present.

The values returned are the CharSequence.toString() for the road provided.

Returns
String

getDestinationTravelEstimates

public List<TravelEstimate> getDestinationTravelEstimates ()

Returns a list of TravelEstimates added via Trip.Builder.addDestinationTravelEstimate(TravelEstimate).

Returns
List<TravelEstimate>

getDestinations

public List<DestinationController> getDestinations ()

Returns a list of DestinationControllers, each containing a Destination added via Trip.Builder.addDestination(Destination).

Returns
List<DestinationController>

getStepTravelEstimates

public List<TravelEstimate> getStepTravelEstimates ()

Returns a list of TravelEstimates added via Trip.Builder.addStepTravelEstimate(TravelEstimate).

Returns
List<TravelEstimate>

getSteps

public List<StepController> getSteps ()

Returns a list of StepControllers, each containing a Step added via Trip.Builder.addStep(Step).

Returns
List<StepController>

isLoading

public boolean isLoading ()

Returns
boolean

of

public static TripController of (Trip trip)

Creates a TripController to control a Trip for testing.

Parameters
trip Trip

Returns
TripController