public abstract class OptimizationResponse
extends java.lang.Object
implements java.io.Serializable
| Modifier and Type | Class and Description |
|---|---|
static class |
OptimizationResponse.Builder
This builder can be used to set the values describing the
OptimizationResponse. |
| Constructor and Description |
|---|
OptimizationResponse() |
| Modifier and Type | Method and Description |
|---|---|
static OptimizationResponse.Builder |
builder()
Create a new instance of this class by using the
OptimizationResponse.Builder class. |
abstract java.lang.String |
code()
String indicating the state of the response.
|
abstract OptimizationResponse.Builder |
toBuilder()
Convert the current
OptimizationResponse to its builder holding the currently assigned
values. |
abstract java.util.List<com.mapbox.api.directions.v5.models.DirectionsRoute> |
trips()
List of trip
DirectionsRoute objects. |
static com.google.gson.TypeAdapter<OptimizationResponse> |
typeAdapter(com.google.gson.Gson gson)
Gson type adapter for parsing Gson to this class.
|
abstract java.util.List<OptimizationWaypoint> |
waypoints()
List of
OptimizationWaypoint objects. |
@NonNull public static OptimizationResponse.Builder builder()
OptimizationResponse.Builder class.OptimizationResponse.Builder for creating a new instance@Nullable public abstract java.lang.String code()
Ok.
On error, the server responds with different HTTP status codes. For responses with HTTP status codes lower than 500, the JSON response body includes the code property, which may be used by client programs to manage control flow. The response body may also include a message property, with a human-readable explanation of the error. If a server error occurs, the HTTP status code will be 500 or higher and the response will not include a code property. Possible errors include:
200 Normal success case200 For one coordinate no route to other coordinates
could be found. Check for impossible routes (e.g. routes over oceans without ferry
connections).200 For the given combination of source,
destination and roundtrip, this request is not supported.404 Use a valid profile422 The given request was not valid. The message key
of the response will hold an explanation of the invalid input.OK@Nullable public abstract java.util.List<OptimizationWaypoint> waypoints()
OptimizationWaypoint objects. Each waypoint is an input coordinate snapped to
the road and path network. The waypoints appear in the list in the order of the input
coordinates.OptimizationWaypoints in the order of the input coordinates@Nullable public abstract java.util.List<com.mapbox.api.directions.v5.models.DirectionsRoute> trips()
DirectionsRoute objects. Will have zero or one trip.DirectionsRoute either having a size zero or onepublic abstract OptimizationResponse.Builder toBuilder()
OptimizationResponse to its builder holding the currently assigned
values. This allows you to modify a single variable and then rebuild the object resulting in
an updated and modified OptimizationResponse.OptimizationResponse.Builder with the same values set to match the ones
defined in this OptimizationResponsepublic static com.google.gson.TypeAdapter<OptimizationResponse> typeAdapter(com.google.gson.Gson gson)
gson - the built Gson object