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 |
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 |
routeOptions(RouteOptions routeOptions)
Holds onto the parameter information used when making the directions request.
|
abstract DirectionsRoute.Builder |
voiceLanguage(java.lang.String voiceLanguage)
String of the language to be used for voice instructions.
|
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.
|
public abstract DirectionsRoute.Builder distance(@Nullable java.lang.Double distance)
distance
- a double number with unit meterspublic abstract DirectionsRoute.Builder duration(@Nullable java.lang.Double duration)
duration
- a double number with unit secondspublic abstract DirectionsRoute.Builder geometry(@Nullable java.lang.String geometry)
geometry
- an encoded polyline stringpublic abstract DirectionsRoute.Builder weight(@Nullable java.lang.Double weight)
weight
- the weight value provided from the API as a double
valuepublic 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 routepublic abstract DirectionsRoute.Builder legs(@Nullable java.util.List<RouteLeg> legs)
legs
- list of RouteLeg
objectspublic 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 routepublic abstract DirectionsRoute.Builder voiceLanguage(@Nullable java.lang.String voiceLanguage)
voiceLanguage
- String compatible with voice instructions, null otherwisepublic abstract DirectionsRoute build()
DirectionsRoute
object.DirectionsRoute
using the provided values in this builder