public abstract static class MapboxDirections.Builder
extends java.lang.Object
MapboxDirections
.Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
abstract MapboxDirections.Builder |
accessToken(java.lang.String accessToken)
A valid Mapbox Access Token used to making the request.
|
abstract MapboxDirections |
build()
This uses the provided parameters set using the
MapboxDirections.Builder and first checks that all
values are valid, and creates a new MapboxDirections object with the values provided. |
abstract MapboxDirections.Builder |
clientAppName(java.lang.String clientAppName)
Base package name or other simple string identifier.
|
abstract MapboxDirections.Builder |
eventListener(okhttp3.EventListener eventListener)
Adds an optional event listener to set in the OkHttp client.
|
abstract MapboxDirections.Builder |
interceptor(okhttp3.Interceptor interceptor)
Adds an optional interceptor to set in the OkHttp client.
|
abstract MapboxDirections.Builder |
networkInterceptor(okhttp3.Interceptor interceptor)
Adds an optional network interceptor to set in the OkHttp client.
|
abstract MapboxDirections.Builder |
routeOptions(com.mapbox.api.directions.v5.models.RouteOptions routeOptions)
Set of options specified for this directions request.
|
abstract MapboxDirections.Builder |
usePostMethod(java.lang.Boolean usePost)
Use POST method to request data.
|
@NonNull public abstract MapboxDirections.Builder accessToken(@NonNull java.lang.String accessToken)
Learn more about the tokens here.
accessToken
- a string representing the Mapbox Access Token@NonNull public abstract MapboxDirections.Builder routeOptions(@NonNull com.mapbox.api.directions.v5.models.RouteOptions routeOptions)
The options defined here reflect Directions API documentation. Warning: `MapboxDirections` doesn't support unrecognized properties from `RouteOptions`.
routeOptions
- route request optionspublic abstract MapboxDirections.Builder clientAppName(@Nullable java.lang.String clientAppName)
clientAppName
- base package name or other simple string identifierpublic abstract MapboxDirections.Builder interceptor(@Nullable okhttp3.Interceptor interceptor)
interceptor
- to set for OkHttppublic abstract MapboxDirections.Builder networkInterceptor(@Nullable okhttp3.Interceptor interceptor)
interceptor
- to set for OkHttppublic abstract MapboxDirections.Builder eventListener(@Nullable okhttp3.EventListener eventListener)
eventListener
- to set for OkHttppublic abstract MapboxDirections.Builder usePostMethod(@Nullable java.lang.Boolean usePost)
MapboxService.MAX_URL_SIZE
,
then POST is used by default.usePost
- true to use POST method or false and null for GET methodpublic abstract MapboxDirections build()
MapboxDirections.Builder
and first checks that all
values are valid, and creates a new MapboxDirections
object with the values provided.