public abstract class DirectionsRoute extends DirectionsJsonObject
| Modifier and Type | Class and Description |
|---|---|
static class |
DirectionsRoute.Builder
This builder can be used to set the values describing the
DirectionsRoute. |
| Constructor and Description |
|---|
DirectionsRoute() |
| Modifier and Type | Method and Description |
|---|---|
static DirectionsRoute.Builder |
builder()
Create a new instance of this class by using the
DirectionsRoute.Builder class. |
abstract java.lang.Double |
distance()
The distance traveled from origin to destination.
|
abstract java.lang.Double |
duration()
The estimated travel time from origin to destination.
|
static DirectionsRoute |
fromJson(java.lang.String json)
Create a new instance of this class by passing in a formatted valid JSON String.
|
abstract java.lang.String |
geometry()
Gives the geometry of the route.
|
abstract java.util.List<RouteLeg> |
legs()
A Leg is a route between only two waypoints.
|
abstract RouteOptions |
routeOptions()
Holds onto the parameter information used when making the directions request.
|
abstract DirectionsRoute.Builder |
toBuilder()
Convert the current
DirectionsRoute to its builder holding the currently assigned
values. |
static com.google.gson.TypeAdapter<DirectionsRoute> |
typeAdapter(com.google.gson.Gson gson)
Gson type adapter for parsing Gson to this class.
|
abstract java.lang.String |
voiceLanguage()
String of the language to be used for voice instructions.
|
abstract java.lang.Double |
weight()
The calculated weight of the route.
|
abstract java.lang.String |
weightName()
The name of the weight profile used while calculating during extraction phase.
|
toJsonpublic static DirectionsRoute.Builder builder()
DirectionsRoute.Builder class.DirectionsRoute.Builder for creating a new instance@Nullable public abstract java.lang.Double distance()
@Nullable public abstract java.lang.Double duration()
@Nullable public abstract java.lang.String geometry()
@Nullable public abstract java.lang.Double weight()
double value@Nullable @SerializedName(value="weight_name") public abstract java.lang.String weightName()
routability which is duration based, with additional penalties for less desirable
maneuvers.@Nullable public abstract java.util.List<RouteLeg> legs()
RouteLeg objects@Nullable public abstract RouteOptions routeOptions()
RouteOptionss object which holds onto critical information from the request
that cannot be derived directly from the directions route@Nullable @SerializedName(value="voiceLocale") public abstract java.lang.String voiceLanguage()
MapboxDirections.language() is not compatible with API Voice.public abstract DirectionsRoute.Builder toBuilder()
DirectionsRoute to its builder holding the currently assigned
values. This allows you to modify a single property and then rebuild the object resulting in
an updated and modified DirectionsRoute.DirectionsRoute.Builder with the same values set to match the ones defined
in this DirectionsRoutepublic static com.google.gson.TypeAdapter<DirectionsRoute> typeAdapter(com.google.gson.Gson gson)
gson - the built Gson objectpublic static DirectionsRoute fromJson(java.lang.String json)
json - a formatted valid JSON string defining a GeoJson Directions Route