public abstract static class MapboxSpeech.Builder
extends java.lang.Object
Constructor and Description |
---|
Builder() |
Modifier and Type | Method and Description |
---|---|
abstract MapboxSpeech.Builder |
accessToken(java.lang.String accessToken)
Required to call when this is being built.
|
abstract MapboxSpeech.Builder |
baseUrl(java.lang.String baseUrl)
Optionally change the APIs base URL to something other then the default Mapbox one.
|
MapboxSpeech |
build()
This uses the provided parameters set using the
MapboxSpeech.Builder and first checks that all
values are valid, formats the values as strings for easier consumption by the API, and lastly
creates a new MapboxSpeech object with the values provided. |
abstract MapboxSpeech.Builder |
cache(okhttp3.Cache cache)
Adds an optional cache to set in the OkHttp client.
|
abstract MapboxSpeech.Builder |
instruction(java.lang.String instruction)
Add the instruction text to dictate, either as plain text or ssml.
|
abstract MapboxSpeech.Builder |
interceptor(okhttp3.Interceptor interceptor)
Adds an optional interceptor to set in the OkHttp client.
|
abstract MapboxSpeech.Builder |
language(java.lang.String language)
Language of which to request the instructions be spoken.
|
abstract MapboxSpeech.Builder |
networkInterceptor(okhttp3.Interceptor interceptor)
Adds an optional network interceptor to set in the OkHttp client.
|
abstract MapboxSpeech.Builder |
outputType(java.lang.String outputType)
Output format for spoken instructions.
|
abstract MapboxSpeech.Builder |
textType(java.lang.String textType)
Format which the input is specified.
|
public abstract MapboxSpeech.Builder language(java.lang.String language)
language
- as a string, i.e., "en-us"public abstract MapboxSpeech.Builder textType(java.lang.String textType)
textType
- either text or ssmlpublic abstract MapboxSpeech.Builder outputType(java.lang.String outputType)
outputType
- either mp3 or jsonpublic abstract MapboxSpeech.Builder accessToken(@NonNull java.lang.String accessToken)
ServicesException
will be thrown.accessToken
- Mapbox access token, You must have a Mapbox account in order to use
the Optimization APIpublic abstract MapboxSpeech.Builder instruction(@NonNull java.lang.String instruction)
instruction
- to dictatepublic abstract MapboxSpeech.Builder baseUrl(@NonNull java.lang.String baseUrl)
baseUrl
- base url used as end pointpublic abstract MapboxSpeech.Builder cache(okhttp3.Cache cache)
cache
- to set for OkHttppublic abstract MapboxSpeech.Builder interceptor(okhttp3.Interceptor interceptor)
interceptor
- to set for OkHttppublic abstract MapboxSpeech.Builder networkInterceptor(okhttp3.Interceptor interceptor)
interceptor
- to set for OkHttppublic MapboxSpeech build()
MapboxSpeech.Builder
and first checks that all
values are valid, formats the values as strings for easier consumption by the API, and lastly
creates a new MapboxSpeech
object with the values provided.com.mapbox.core.exceptions.ServicesException
- when a provided parameter is detected to be incorrect