public class OptimizedTripsResponse extends Object
Constructor and Description |
---|
OptimizedTripsResponse()
Empty constructor
|
OptimizedTripsResponse(List<DirectionsRoute> trips,
List<OptimizationWaypoint> waypoints)
Constructor taking in a list of
DirectionsRoute s along with a list of DirectionsWaypoint s. |
Modifier and Type | Method and Description |
---|---|
String |
getCode()
String indicating the state of the response.
|
List<DirectionsRoute> |
getTrips()
List of trip
DirectionsRoute objects. |
List<OptimizationWaypoint> |
getWaypoints()
List of
OptimizationWaypoint objects. |
void |
setCode(String code)
A
String representing the response code the API typically returns. |
void |
setTrips(List<DirectionsRoute> trips)
List of trip
DirectionsRoute objects. |
void |
setWaypoints(List<OptimizationWaypoint> waypoints)
List of
OptimizationWaypoint objects. |
public OptimizedTripsResponse()
public OptimizedTripsResponse(List<DirectionsRoute> trips, List<OptimizationWaypoint> waypoints)
DirectionsRoute
s along with a list of DirectionsWaypoint
s.trips
- a list of DirectionsRoute
s used for building this object.waypoints
- a list of DirectionsWaypoint
s used for building this object. In typical cases, you'll
want the waypoints to match the ones making up the directions route.public String getCode()
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
.public void setCode(String code)
String
representing the response code the API typically returns. See
getCode()
for a list of responses the API provides.code
- a String
representing the response code the API typically returns.public List<OptimizationWaypoint> getWaypoints()
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.OptimizationWaypoint
s in the order of the input coordinates.public void setWaypoints(List<OptimizationWaypoint> waypoints)
OptimizationWaypoint
objects. Each waypoint should be an input coordinate snapped to the road and
path network. The waypoints should appear in the list in the order of the input coordinates.waypoints
- a list of OptimizationWaypoint
s in the order of the input coordinates.public List<DirectionsRoute> getTrips()
DirectionsRoute
objects. Will have zero or one trip.DirectionsRoute
either having a size zero or one.public void setTrips(List<DirectionsRoute> trips)
DirectionsRoute
objects. Should have either zero or one trip.trips
- list of DirectionsRoute
either having a size zero or one.© 2015–2016 Mapbox. All rights reserved.