public final class

TravelEstimate.Builder

extends java.lang.Object

 java.lang.Object

↳androidx.car.app.navigation.model.TravelEstimate.Builder

Overview

A builder of TravelEstimate.

Summary

Constructors
publicBuilder(Distance remainingDistance, DateTimeWithZone arrivalTimeAtDestination)

Constructs a new builder of TravelEstimate.

publicBuilder(Distance remainingDistance, java.time.ZonedDateTime arrivalTimeAtDestination)

Constructs a new builder of TravelEstimate.

Methods
public TravelEstimatebuild()

Constructs the TravelEstimate defined by this builder.

public TravelEstimate.BuildersetRemainingDistanceColor(CarColor remainingDistanceColor)

Sets the color of the remaining distance text.

public TravelEstimate.BuildersetRemainingTime(java.time.Duration remainingTime)

Sets the estimated time remaining until arriving at the destination.

public TravelEstimate.BuildersetRemainingTimeColor(CarColor remainingTimeColor)

Sets the color of the remaining time text.

public TravelEstimate.BuildersetRemainingTimeSeconds(long remainingTimeSeconds)

Sets the estimated time remaining until arriving at the destination, in seconds.

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

Constructors

public Builder(Distance remainingDistance, DateTimeWithZone arrivalTimeAtDestination)

Constructs a new builder of TravelEstimate.

Parameters:

remainingDistance: The estimated remaining Distance until arriving at the destination
arrivalTimeAtDestination: The arrival time with the time zone information provided for the destination

public Builder(Distance remainingDistance, java.time.ZonedDateTime arrivalTimeAtDestination)

Constructs a new builder of TravelEstimate.

Parameters:

remainingDistance: The estimated remaining Distance until arriving at the destination
arrivalTimeAtDestination: The arrival time with the time zone information provided for the destination

Methods

public TravelEstimate.Builder setRemainingTimeSeconds(long remainingTimeSeconds)

Sets the estimated time remaining until arriving at the destination, in seconds.

If not set, TravelEstimate.REMAINING_TIME_UNKNOWN will be used.

Note that TravelEstimate.REMAINING_TIME_UNKNOWN may not be supported depending on where the TravelEstimate is used. See the documentation of where TravelEstimate is used for any restrictions that might apply.

public TravelEstimate.Builder setRemainingTime(java.time.Duration remainingTime)

Sets the estimated time remaining until arriving at the destination.

If not set, TravelEstimate.REMAINING_TIME_UNKNOWN will be used.

public TravelEstimate.Builder setRemainingTimeColor(CarColor remainingTimeColor)

Sets the color of the remaining time text.

Depending on contrast requirements, capabilities of the vehicle screens, or other factors, the color may be ignored by the host or overridden by the vehicle system.

If not set, CarColor.DEFAULT will be used.

Custom colors created with CarColor.createCustom(int, int) are not supported.

public TravelEstimate.Builder setRemainingDistanceColor(CarColor remainingDistanceColor)

Sets the color of the remaining distance text.

Depending on contrast requirements, capabilities of the vehicle screens, or other factors, the color may be ignored by the host or overridden by the vehicle system.

If not set, CarColor.DEFAULT will be used.

Custom colors created with CarColor.createCustom(int, int) are not supported.

public TravelEstimate build()

Constructs the TravelEstimate defined by this builder.