public abstract static class OptimizationResponse.Builder
extends java.lang.Object
OptimizationResponse
.Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
abstract OptimizationResponse |
build()
Build a new
OptimizationResponse object. |
abstract OptimizationResponse.Builder |
code(java.lang.String code)
String indicating the state of the response.
|
abstract OptimizationResponse.Builder |
trips(java.util.List<com.mapbox.api.directions.v5.models.DirectionsRoute> trips)
List of trip
DirectionsRoute objects. |
abstract OptimizationResponse.Builder |
waypoints(java.util.List<OptimizationWaypoint> waypoints)
List of
OptimizationWaypoint objects. |
public abstract OptimizationResponse.Builder code(@Nullable 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.code
- string containing the response code. In normal conditions this will return
OK
public abstract OptimizationResponse.Builder waypoints(@Nullable 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.waypoints
- a list of OptimizationWaypoint
s in the order of the input
coordinatespublic abstract OptimizationResponse.Builder trips(@Nullable java.util.List<com.mapbox.api.directions.v5.models.DirectionsRoute> trips)
DirectionsRoute
objects. Will have zero or one trip.trips
- list of DirectionsRoute
either having a size zero or onepublic abstract OptimizationResponse build()
OptimizationResponse
object.OptimizationResponse
using the provided values in this builder