TravelEstimate

public final class TravelEstimate
extends Object

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


Represents the travel estimates to a destination of a trip or for a trip segment, including the remaining time and distance to the destination.

Summary

Nested classes

class TravelEstimate.Builder

A builder of TravelEstimate

Public methods

static TravelEstimate.Builder builder(Distance remainingDistance, long remainingTimeSeconds, DateTimeWithZone arrivalTimeAtDestination)

Constructs a new builder of TravelEstimate.

static TravelEstimate.Builder builder(Distance remainingDistance, Duration remainingTime, ZonedDateTime arrivalTimeAtDestination)

Constructs a new builder of TravelEstimate.

static TravelEstimate create(Distance remainingDistance, Duration remainingTime, ZonedDateTime arrivalTimeAtDestination)
static TravelEstimate create(Distance remainingDistance, long remainingTimeSeconds, DateTimeWithZone arrivalTimeAtDestination)
boolean equals(Object other)
DateTimeWithZone getArrivalTimeAtDestination()
Distance getRemainingDistance()
CarColor getRemainingDistanceColor()
CarColor getRemainingTimeColor()
long getRemainingTimeSeconds()
int hashCode()
String toString()

Inherited methods

Public methods

builder

public static TravelEstimate.Builder builder (Distance remainingDistance, 
                long remainingTimeSeconds, 
                DateTimeWithZone arrivalTimeAtDestination)

Constructs a new builder of TravelEstimate.

Parameters
remainingDistance Distance: The estimated remaining Distance until arriving at the destination.

remainingTimeSeconds long: The estimated time remaining until arriving at the destination, in seconds.

arrivalTimeAtDestination DateTimeWithZone: The arrival time with the time zone information provided for the destination.

Returns
TravelEstimate.Builder

Throws
IllegalArgumentException if remainingTimeSeconds is a negative value.
NullPointerException if remainingDistance is null
NullPointerException if arrivalTimeAtDestination is null

builder

public static TravelEstimate.Builder builder (Distance remainingDistance, 
                Duration remainingTime, 
                ZonedDateTime arrivalTimeAtDestination)

Constructs a new builder of TravelEstimate.

Parameters
remainingDistance Distance: The estimated remaining Distance until arriving at the destination.

remainingTime Duration: The estimated time remaining until arriving at the destination.

arrivalTimeAtDestination ZonedDateTime: The arrival time with the time zone information provided for the destination.

Returns
TravelEstimate.Builder

Throws
IllegalArgumentException if remainingTime contains a negative duration.
NullPointerException if remainingDistance is null
NullPointerException if remainingTime is null
NullPointerException if arrivalTimeAtDestination is null

create

public static TravelEstimate create (Distance remainingDistance, 
                Duration remainingTime, 
                ZonedDateTime arrivalTimeAtDestination)

Parameters
remainingDistance Distance

remainingTime Duration

arrivalTimeAtDestination ZonedDateTime

Returns
TravelEstimate

create

public static TravelEstimate create (Distance remainingDistance, 
                long remainingTimeSeconds, 
                DateTimeWithZone arrivalTimeAtDestination)

Parameters
remainingDistance Distance

remainingTimeSeconds long

arrivalTimeAtDestination DateTimeWithZone

Returns
TravelEstimate

equals

public boolean equals (Object other)

Parameters
other Object

Returns
boolean

getArrivalTimeAtDestination

public DateTimeWithZone getArrivalTimeAtDestination ()

Returns
DateTimeWithZone

getRemainingDistance

public Distance getRemainingDistance ()

Returns
Distance

getRemainingDistanceColor

public CarColor getRemainingDistanceColor ()

Returns
CarColor

getRemainingTimeColor

public CarColor getRemainingTimeColor ()

Returns
CarColor

getRemainingTimeSeconds

public long getRemainingTimeSeconds ()

Returns
long

hashCode

public int hashCode ()

Returns
int

toString

public String toString ()

Returns
String