public abstract class DirectionsRoute
extends java.lang.Object
implements java.io.Serializable
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.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.
|
public static DirectionsRoute.Builder builder()
DirectionsRoute.Builder
class.DirectionsRoute.Builder
for creating a new instancepublic static DirectionsRoute fromJson(java.lang.String json)
json
- a formatted valid JSON string defining a GeoJson Directions Route@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()
RouteOptions
s object which holds onto critical information from the request
that cannot be derived directly from the directions routepublic abstract DirectionsRoute.Builder toBuilder()
DirectionsRoute
to its builder holding the currently assigned
values. This allows you to modify a single variable and then rebuild the project resulting in
an updated and modifier DirectionsRoute
.DirectionsRoute.Builder
with the same values set to match the ones defined
in this DirectionsRoute
public static com.google.gson.TypeAdapter<DirectionsRoute> typeAdapter(com.google.gson.Gson gson)
gson
- the built Gson
object