Save the date! Android Dev Summit is coming to Sunnyvale, CA on Oct 23-24, 2019.

NavigationState.Builder

public static final class NavigationState.Builder
extends Object

java.lang.Object
   ↳ androidx.car.cluster.navigation.NavigationState.Builder


Builder for creating a NavigationState

Summary

Public constructors

NavigationState.Builder()

Public methods

NavigationState.Builder addDestination(Destination destination)

Add a destination or intermediate stop in the navigation.

NavigationState.Builder addStep(Step step)

Add a navigation step.

NavigationState build()

Returns a NavigationState built with the provided information.

NavigationState.Builder setCurrentSegment(Segment segment)

Sets the current segment being driven, or null if the segment being driven is unknown.

NavigationState.Builder setServiceStatus(NavigationState.ServiceStatus serviceStatus, ServiceStatus... fallbackServiceStatuses)

Sets the service status (e.g.: normal operation, re-routing in progress, etc.)

Inherited methods

Public constructors

public NavigationState.Builder ()

Public methods

addDestination

public NavigationState.Builder addDestination (Destination destination)

Add a destination or intermediate stop in the navigation. Destinations should be provided from nearest to furthest.

Parameters
destination Destination

Returns
NavigationState.Builder this object for chaining

addStep

public NavigationState.Builder addStep (Step step)

Add a navigation step. Steps should be provided in order of execution. It is up to the producer to decide how many steps in advance will be provided.

Parameters
step Step

Returns
NavigationState.Builder this object for chaining

build

public NavigationState build ()

Returns a NavigationState built with the provided information.

Returns
NavigationState

setCurrentSegment

public NavigationState.Builder setCurrentSegment (Segment segment)

Sets the current segment being driven, or null if the segment being driven is unknown.

Parameters
segment Segment

Returns
NavigationState.Builder

setServiceStatus

public NavigationState.Builder setServiceStatus (NavigationState.ServiceStatus serviceStatus, 
                ServiceStatus... fallbackServiceStatuses)

Sets the service status (e.g.: normal operation, re-routing in progress, etc.)

Parameters
serviceStatus NavigationState.ServiceStatus: current service status

fallbackServiceStatuses ServiceStatus: variations of the current service status (ordered from specific to generic), in case the main one is not understood by the consumer of this API. In such scenario, consumers will receive the first value in this list that they can deserialize.

Returns
NavigationState.Builder this object for chaining