public final class

NavigationState.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.car.cluster.navigation.NavigationState.Builder

Overview

Builder for creating a NavigationState

Summary

Constructors
publicBuilder()

Methods
public NavigationState.BuilderaddDestination(Destination destination)

Add a destination or intermediate stop in the navigation.

public NavigationState.BuilderaddStep(Step step)

Add a navigation step.

public NavigationStatebuild()

Returns a NavigationState built with the provided information.

public NavigationState.BuildersetCurrentSegment(Segment segment)

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

public NavigationState.BuildersetServiceStatus(NavigationState.ServiceStatus serviceStatus, NavigationState.ServiceStatus fallbackServiceStatuses[])

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

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public Builder()

Methods

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.

Returns:

this object for chaining

public NavigationState.Builder addDestination(Destination destination)

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

Returns:

this object for chaining

public NavigationState.Builder setCurrentSegment(Segment segment)

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

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

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

Parameters:

serviceStatus: current service status
fallbackServiceStatuses: 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:

this object for chaining

public NavigationState build()

Returns a NavigationState built with the provided information.