public abstract class RouteLeg extends DirectionsJsonObject
DirectionsWaypoint
.Modifier and Type | Class and Description |
---|---|
static class |
RouteLeg.Builder
This builder can be used to set the values describing the
RouteLeg . |
Constructor and Description |
---|
RouteLeg() |
Modifier and Type | Method and Description |
---|---|
abstract java.util.List<Admin> |
admins()
An array of objects describing the administrative boundaries the route leg travels through.
|
abstract LegAnnotation |
annotation()
A
LegAnnotation that contains additional details about each line segment along the
route geometry. |
static RouteLeg.Builder |
builder()
Create a new instance of this class by using the
RouteLeg.Builder class. |
abstract java.util.List<Closure> |
closures()
A list of closures that occur on this leg.
|
abstract java.lang.Double |
distance()
The distance traveled from one waypoint to another.
|
abstract java.lang.Double |
duration()
The estimated travel time from one waypoint to another.
|
abstract java.lang.Double |
durationTypical()
The typical travel time for traversing this RouteLeg.
|
static RouteLeg |
fromJson(java.lang.String json)
Create a new instance of this class by passing in a formatted valid JSON String.
|
abstract java.util.List<Incident> |
incidents()
A list of incidents that occur on this leg.
|
abstract java.util.List<LegStep> |
steps()
Gives a List including all the steps to get from one waypoint to another.
|
abstract java.lang.String |
summary()
A short human-readable summary of major roads traversed.
|
abstract RouteLeg.Builder |
toBuilder()
Convert the current
RouteLeg to its builder holding the currently assigned
values. |
static com.google.gson.TypeAdapter<RouteLeg> |
typeAdapter(com.google.gson.Gson gson)
Gson type adapter for parsing Gson to this class.
|
abstract java.util.List<SilentWaypoint> |
viaWaypoints()
When the semicolon-separated list waypoints parameter is used in the request,
an array per leg is returned that describes where a particular waypoint from
the root-level array matches to the route.
|
getUnrecognizedJsonProperties, getUnrecognizedPropertiesNames, getUnrecognizedProperty, toJson
public static RouteLeg.Builder builder()
RouteLeg.Builder
class.RouteLeg.Builder
for creating a new instance@Nullable @SerializedName(value="via_waypoints") public abstract java.util.List<SilentWaypoint> viaWaypoints()
@Nullable public abstract java.lang.Double distance()
@Nullable public abstract java.lang.Double duration()
@Nullable @SerializedName(value="duration_typical") public abstract java.lang.Double durationTypical()
@Nullable public abstract java.lang.String summary()
@Nullable public abstract java.util.List<Admin> admins()
StepIntersection.adminIndex()
on the intersection object
to look up the admin for each intersection in this array.@Nullable public abstract java.util.List<LegStep> steps()
LegStep
@Nullable public abstract java.util.List<Incident> incidents()
Incident
@Nullable public abstract LegAnnotation annotation()
LegAnnotation
that contains additional details about each line segment along the
route geometry. If you'd like to receiving this, you must request it inside your Directions
request before executing the call.LegAnnotation
object@Nullable public abstract java.util.List<Closure> closures()
Closure
public abstract RouteLeg.Builder toBuilder()
RouteLeg
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 RouteLeg
.RouteLeg.Builder
with the same values set to match the ones defined
in this RouteLeg
public static com.google.gson.TypeAdapter<RouteLeg> typeAdapter(com.google.gson.Gson gson)
gson
- the built Gson
objectpublic static RouteLeg fromJson(java.lang.String json)
json
- a formatted valid JSON string defining a RouteLeg