public abstract class MatrixResponse
extends java.lang.Object
implements java.io.Serializable
Modifier and Type | Class and Description |
---|---|
static class |
MatrixResponse.Builder
This builder can be used to set the values describing the
MatrixResponse . |
Constructor and Description |
---|
MatrixResponse() |
Modifier and Type | Method and Description |
---|---|
static MatrixResponse.Builder |
builder()
Create a new instance of this class using the
MatrixResponse.Builder which provides a
to pass in variables which define the instance. |
abstract java.lang.String |
code()
String indicating the state of the response.
|
abstract java.util.List<com.mapbox.api.directions.v5.models.DirectionsWaypoint> |
destinations()
List of
DirectionsWaypoint objects. |
abstract java.util.List<java.lang.Double[]> |
distances()
Distances as a list of arrays representing the matrix in row-major order.
|
abstract java.util.List<java.lang.Double[]> |
durations()
Durations as a list of arrays representing the matrix in row-major order.
|
abstract java.util.List<com.mapbox.api.directions.v5.models.DirectionsWaypoint> |
sources()
List of
DirectionsWaypoint objects. |
abstract MatrixResponse.Builder |
toBuilder()
Convert the current
MatrixResponse to its builder holding the currently assigned
values. |
static com.google.gson.TypeAdapter<MatrixResponse> |
typeAdapter(com.google.gson.Gson gson)
Gson type adapter for parsing Gson to this class.
|
public static MatrixResponse.Builder builder()
MatrixResponse.Builder
which provides a
to pass in variables which define the instance.MatrixResponse.Builder
for creating a new instance@NonNull 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.
Note that in cases where no route is found between a source and destination, no error will be returned, but instead the respective value in the durations matrix will be null.
@Nullable public abstract java.util.List<com.mapbox.api.directions.v5.models.DirectionsWaypoint> destinations()
DirectionsWaypoint
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,
or in the order as specified in the destinations query parameter.DirectionsWaypoint
@Nullable public abstract java.util.List<com.mapbox.api.directions.v5.models.DirectionsWaypoint> sources()
DirectionsWaypoint
objects. Each waypoints is an input coordinate snapped to
the road and path network. The waypoints appear in the list in the order of the input
coordinates, or in the order as specified in the sources query parameter.DirectionsWaypoint
@Nullable public abstract java.util.List<java.lang.Double[]> durations()
@Nullable public abstract java.util.List<java.lang.Double[]> distances()
public abstract MatrixResponse.Builder toBuilder()
MatrixResponse
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 MatrixResponse
.MatrixResponse.Builder
with the same values set to match the ones
defined in this MatrixResponse
public static com.google.gson.TypeAdapter<MatrixResponse> typeAdapter(com.google.gson.Gson gson)
gson
- the built Gson
object