public abstract class DirectionsResponse extends DirectionsJsonObject
Modifier and Type | Class and Description |
---|---|
static class |
DirectionsResponse.Builder
This builder can be used to set the values describing the
DirectionsResponse . |
Constructor and Description |
---|
DirectionsResponse() |
Modifier and Type | Method and Description |
---|---|
static DirectionsResponse.Builder |
builder()
Create a new instance of this class by using the
DirectionsResponse.Builder class. |
abstract java.lang.String |
code()
String indicating the state of the response.
|
static DirectionsResponse |
fromJson(java.io.Reader json)
Deserializes a new instance of this class reading from the specified reader.
|
static DirectionsResponse |
fromJson(java.io.Reader json,
RouteOptions routeOptions)
Deserializes a new instance of this class reading from the specified reader.
|
static DirectionsResponse |
fromJson(java.lang.String json)
Create a new instance of this class by passing in a formatted valid JSON String.
|
static DirectionsResponse |
fromJson(java.lang.String json,
RouteOptions routeOptions)
Create a new instance of this class by passing in a formatted valid JSON String.
|
static DirectionsResponse |
fromJson(java.lang.String json,
RouteOptions routeOptions,
java.lang.String requestUuid)
Deprecated.
use
fromJson(String, RouteOptions) instead |
abstract java.lang.String |
message()
Optionally shows up in a directions response if an error or something unexpected occurred.
|
abstract Metadata |
metadata()
A complex data structure that provides information about the source of the response.
|
abstract java.util.List<DirectionsRoute> |
routes()
List containing all the different route options.
|
abstract DirectionsResponse.Builder |
toBuilder()
Convert the current
DirectionsResponse to its builder holding the currently assigned
values. |
static com.google.gson.TypeAdapter<DirectionsResponse> |
typeAdapter(com.google.gson.Gson gson)
Gson type adapter for parsing Gson to this class.
|
DirectionsResponse |
updateWithRequestData(RouteOptions routeOptions)
Exposes an option to enhance an existing response with the request data which might be required
by downstream consumers of the directions models (like Mapbox Navigation SDK) to provide
rerouting and route refreshing features.
|
abstract java.lang.String |
uuid()
A universally unique identifier (UUID) for identifying and executing a similar specific route
in the future.
|
abstract java.util.List<DirectionsWaypoint> |
waypoints()
List of
DirectionsWaypoint objects. |
getUnrecognizedJsonProperties, getUnrecognizedPropertiesNames, getUnrecognizedProperty, toJson
@NonNull public static DirectionsResponse.Builder builder()
DirectionsResponse.Builder
class.DirectionsResponse.Builder
for creating a new instance@NonNull public abstract java.lang.String code()
@Nullable public abstract java.lang.String message()
@Nullable public abstract 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.DirectionsWaypoint
objects ordered from start of route till the end@NonNull public abstract java.util.List<DirectionsRoute> routes()
DirectionsRoute
objects.DirectionsRoute
objects@Nullable public abstract java.lang.String uuid()
@Nullable public abstract Metadata metadata()
public abstract DirectionsResponse.Builder toBuilder()
DirectionsResponse
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 DirectionsResponse
.DirectionsResponse.Builder
with the same values set to match the ones defined
in this DirectionsResponse
public static com.google.gson.TypeAdapter<DirectionsResponse> typeAdapter(com.google.gson.Gson gson)
gson
- the built Gson
objectpublic static DirectionsResponse fromJson(@NonNull java.lang.String json)
Consider using fromJson(String, RouteOptions)
if the result is used with
downstream consumers of the directions models (like Mapbox Navigation SDK)
to provide rerouting and route refreshing features.
json
- a formatted valid JSON string defining a GeoJson Directions ResponsefromJson(String, RouteOptions)
public static DirectionsResponse fromJson(@NonNull java.io.Reader json)
Consider using fromJson(Reader, RouteOptions)
if the result is used with
downstream consumers of the directions models (like Mapbox Navigation SDK)
to provide rerouting and route refreshing features.
json
- a reader producing a valid JSON defining a GeoJson Directions ResponsefromJson(Reader, RouteOptions)
@Deprecated public static DirectionsResponse fromJson(@NonNull java.lang.String json, @Nullable RouteOptions routeOptions, @Nullable java.lang.String requestUuid)
fromJson(String, RouteOptions)
instead
The parameters of RouteOptions
that were used to make the original route request
as well as the String
UUID of the original response are needed
by the Navigation SDK to support correct rerouting and route refreshing.
json
- a formatted valid JSON string defining a GeoJson Directions RouterouteOptions
- options that were used during the original route requestrequestUuid
- UUID of the request found in the body of the original response,
see "response.body.uuid"RouteOptions.fromUrl(java.net.URL)
,
RouteOptions.fromJson(String)
public static DirectionsResponse fromJson(@NonNull java.lang.String json, @NonNull RouteOptions routeOptions)
The parameter of RouteOptions
that were used to make the original route request
which might be required by downstream consumers of the directions models
(like Mapbox Navigation SDK) to provide rerouting and route refreshing features.
json
- a formatted valid JSON string defining a GeoJson Directions RouterouteOptions
- options that were used during the original route requestRouteOptions.fromUrl(java.net.URL)
,
RouteOptions.fromJson(String)
public static DirectionsResponse fromJson(@NonNull java.io.Reader json, @NonNull RouteOptions routeOptions)
The parameter of RouteOptions
that were used to make the original route request
which might be required by downstream consumers of the directions models
(like Mapbox Navigation SDK) to provide rerouting and route refreshing features.
json
- a reader producing a valid JSON defining a GeoJson Directions ResponserouteOptions
- options that were used during the original route requestRouteOptions.fromUrl(java.net.URL)
,
RouteOptions.fromJson(String)
@NonNull public DirectionsResponse updateWithRequestData(@NonNull RouteOptions routeOptions)
routeOptions
- options used to generate this responseRouteOptions.fromUrl(java.net.URL)
,
RouteOptions.fromJson(String)
,
fromJson(String)