Destination.Builder

public static final class Destination.Builder
extends Object

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


Builder for creating a Destination

Summary

Public constructors

Destination.Builder()

Public methods

Destination build()

Returns a Destination built with the provided information.

Destination.Builder setAddress(String address)

Sets the destination address (formatted for the current user's locale), or empty if there is no address associated with this destination.

Destination.Builder setDistance(Distance distance)

Sets the distance from the current position to this destination, or null if distance is unknown.

Destination.Builder setEta(ZonedDateTime eta)

Sets the estimated time of arrival to this destination, or null if estimated time of arrival is unknown.

Destination.Builder setLocation(Location location)

Sets the geo-location of this destination, or null if location is unknown.

Destination.Builder setTitle(String title)

Sets the destination title (formatted for the current user's locale), or empty if there is no title associated with this destination.

Inherited methods

Public constructors

Destination.Builder

public Destination.Builder ()

Public methods

build

public Destination build ()

Returns a Destination built with the provided information.

Returns
Destination

setAddress

public Destination.Builder setAddress (String address)

Sets the destination address (formatted for the current user's locale), or empty if there is no address associated with this destination.

Parameters
address String

Returns
Destination.Builder this object for chaining

setDistance

public Destination.Builder setDistance (Distance distance)

Sets the distance from the current position to this destination, or null if distance is unknown.

Parameters
distance Distance

Returns
Destination.Builder this object for chaining

setEta

public Destination.Builder setEta (ZonedDateTime eta)

Sets the estimated time of arrival to this destination, or null if estimated time of arrival is unknown.

Parameters
eta ZonedDateTime

Returns
Destination.Builder this object for chaining

setLocation

public Destination.Builder setLocation (Location location)

Sets the geo-location of this destination, or null if location is unknown.

Parameters
location Location

Returns
Destination.Builder this object for chaining

setTitle

public Destination.Builder setTitle (String title)

Sets the destination title (formatted for the current user's locale), or empty if there is no title associated with this destination.

Parameters
title String

Returns
Destination.Builder this object for chaining