public abstract class MapboxDirections extends com.mapbox.core.MapboxService<com.mapbox.api.directions.v5.models.DirectionsResponse,DirectionsService>
Requesting a route at a bare minimal must include, a Mapbox access token, destination, and an origin.
Modifier and Type | Class and Description |
---|---|
static class |
MapboxDirections.Builder
This builder is used to create a new request to the Mapbox Directions API.
|
Modifier | Constructor and Description |
---|---|
protected |
MapboxDirections() |
Modifier and Type | Method and Description |
---|---|
protected abstract java.lang.String |
baseUrl() |
static MapboxDirections.Builder |
builder()
Build a new
MapboxDirections object with the initial values set for
baseUrl() , profile() , user() , and geometries() . |
void |
enqueueCall(retrofit2.Callback<com.mapbox.api.directions.v5.models.DirectionsResponse> callback)
Wrapper method for Retrofits
Call.enqueue(Callback) call returning a response specific
to the Directions API. |
retrofit2.Response<com.mapbox.api.directions.v5.models.DirectionsResponse> |
executeCall()
Wrapper method for Retrofits
Call.execute() call returning a response specific to the
Directions API. |
protected com.google.gson.GsonBuilder |
getGsonBuilder() |
protected okhttp3.OkHttpClient |
getOkHttpClient() |
protected retrofit2.Call<com.mapbox.api.directions.v5.models.DirectionsResponse> |
initializeCall() |
abstract MapboxDirections.Builder |
toBuilder()
Returns the builder which created this instance of
MapboxDirections and allows for
modification and building a new directions request with new information. |
protected retrofit2.Call<com.mapbox.api.directions.v5.models.DirectionsResponse> initializeCall()
initializeCall
in class com.mapbox.core.MapboxService<com.mapbox.api.directions.v5.models.DirectionsResponse,DirectionsService>
protected com.google.gson.GsonBuilder getGsonBuilder()
getGsonBuilder
in class com.mapbox.core.MapboxService<com.mapbox.api.directions.v5.models.DirectionsResponse,DirectionsService>
public retrofit2.Response<com.mapbox.api.directions.v5.models.DirectionsResponse> executeCall() throws java.io.IOException
Call.execute()
call returning a response specific to the
Directions API.executeCall
in class com.mapbox.core.MapboxService<com.mapbox.api.directions.v5.models.DirectionsResponse,DirectionsService>
java.io.IOException
- Signals that an I/O exception of some sort has occurredpublic void enqueueCall(retrofit2.Callback<com.mapbox.api.directions.v5.models.DirectionsResponse> callback)
Call.enqueue(Callback)
call returning a response specific
to the Directions API. Use this method to make a directions request on the Main Thread.enqueueCall
in class com.mapbox.core.MapboxService<com.mapbox.api.directions.v5.models.DirectionsResponse,DirectionsService>
callback
- a Callback
which is used once the DirectionsResponse
is
created.protected okhttp3.OkHttpClient getOkHttpClient()
getOkHttpClient
in class com.mapbox.core.MapboxService<com.mapbox.api.directions.v5.models.DirectionsResponse,DirectionsService>
@NonNull protected abstract java.lang.String baseUrl()
baseUrl
in class com.mapbox.core.MapboxService<com.mapbox.api.directions.v5.models.DirectionsResponse,DirectionsService>
public static MapboxDirections.Builder builder()
MapboxDirections
object with the initial values set for
baseUrl()
, profile()
, user()
, and geometries()
.MapboxDirections.Builder
object for creating this objectpublic abstract MapboxDirections.Builder toBuilder()
MapboxDirections
and allows for
modification and building a new directions request with new information.MapboxDirections.Builder
with the same variables set as this directions object