public abstract static class DirectionsRoute.Builder
extends java.lang.Object
DirectionsRoute
.Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
abstract DirectionsRoute |
build()
Build a new
DirectionsRoute object. |
abstract DirectionsRoute.Builder |
distance(java.lang.Double distance)
The distance traveled from origin to destination.
|
abstract DirectionsRoute.Builder |
duration(java.lang.Double duration)
The estimated travel time from origin to destination.
|
abstract DirectionsRoute.Builder |
durationTypical(java.lang.Double durationTypical)
The typical travel time from this route's origin to destination.
|
abstract DirectionsRoute.Builder |
geometry(java.lang.String geometry)
Gives the geometry of the route.
|
abstract DirectionsRoute.Builder |
legs(java.util.List<RouteLeg> legs)
A Leg is a route between only two waypoints.
|
abstract DirectionsRoute.Builder |
requestUuid(java.lang.String requestUuid)
The universally unique identifier of the request that produced this route.
|
abstract DirectionsRoute.Builder |
routeIndex(java.lang.String routeIndex)
The index of the route in the list of routes returned by the original response.
|
abstract DirectionsRoute.Builder |
routeOptions(RouteOptions routeOptions)
Holds onto the parameter information used when making the directions request.
|
abstract DirectionsRoute.Builder |
tollCosts(java.util.List<TollCost> tollCosts) |
T |
unrecognizedJsonProperties(java.util.Map<java.lang.String,com.google.gson.JsonElement> unrecognizedProperties)
Use this method to add parameters which are not present in the model yet but are supported
on the Directions API side in the response.
|
abstract DirectionsRoute.Builder |
voiceLanguage(java.lang.String voiceLanguage)
String of the language to be used for voice instructions.
|
abstract DirectionsRoute.Builder |
waypoints(java.util.List<DirectionsWaypoint> waypoints)
List of
DirectionsWaypoint objects. |
abstract DirectionsRoute.Builder |
weight(java.lang.Double weight)
The calculated weight of the route.
|
abstract DirectionsRoute.Builder |
weightName(java.lang.String weightName)
The name of the weight profile used while calculating during extraction phase.
|
@NonNull public abstract DirectionsRoute.Builder distance(@NonNull java.lang.Double distance)
distance
- a double number with unit meters@NonNull public abstract DirectionsRoute.Builder duration(@NonNull java.lang.Double duration)
duration
- a double number with unit seconds@NonNull public abstract DirectionsRoute.Builder durationTypical(@Nullable java.lang.Double durationTypical)
durationTypical
- a double number with unit seconds@NonNull public abstract DirectionsRoute.Builder geometry(@Nullable java.lang.String geometry)
geometry
- an encoded polyline string@NonNull public abstract DirectionsRoute.Builder weight(@Nullable java.lang.Double weight)
weight
- the weight value provided from the API as a double
value@NonNull public abstract DirectionsRoute.Builder weightName(@Nullable java.lang.String weightName)
routability
which is duration based, with additional penalties for less desirable
maneuvers.weightName
- a String representing the weight profile used while calculating the route@NonNull public abstract DirectionsRoute.Builder legs(@Nullable java.util.List<RouteLeg> legs)
legs
- list of RouteLeg
objects@NonNull public abstract DirectionsRoute.Builder waypoints(@Nullable java.util.List<DirectionsWaypoint> waypoints)
DirectionsWaypoint
objects. Each waypoint
is an input coordinate
snapped to the road and path network. The waypoint
appear in the list in the order of
the input coordinates.
Waypoints are returned in the DirectionsRoute
object only when
RouteOptions.waypointsPerRoute()
is set to true. Otherwise they are returned
in the root: DirectionsResponse.waypoints()
.waypoints
- list of DirectionsWaypoint
objects ordered from start of route
till the end@NonNull public abstract DirectionsRoute.Builder routeOptions(@Nullable RouteOptions routeOptions)
routeOptions
- a RouteOptions
s object which holds onto critical information from
the request that cannot be derived directly from the directions route@NonNull public abstract DirectionsRoute.Builder voiceLanguage(@Nullable java.lang.String voiceLanguage)
voiceLanguage
- String compatible with voice instructions, null otherwise@NonNull public abstract DirectionsRoute.Builder requestUuid(@Nullable java.lang.String requestUuid)
requestUuid
- uuid@NonNull public abstract DirectionsRoute.Builder routeIndex(java.lang.String routeIndex)
routeIndex
- string of an int value representing the index@NonNull public abstract DirectionsRoute.Builder tollCosts(@Nullable java.util.List<TollCost> tollCosts)
@NonNull public abstract DirectionsRoute build()
DirectionsRoute
object.DirectionsRoute
using the provided values in this builder@NonNull public T unrecognizedJsonProperties(@Nullable java.util.Map<java.lang.String,com.google.gson.JsonElement> unrecognizedProperties)
unrecognizedProperties
- parameters to add to request