public abstract class RouteOptions
extends java.lang.Object
For example, if I request a driving (profile) with alternatives and continueStraight set to true. I make the request but loose reference and information which built the original request. Thus, If I only want to change a single variable such as the destination coordinate, i'd have to have all the other route information stores so the request was made identical to the previous but only now using this new destination point.
Using this class can provide you wth the information used when the DirectionsRoute
was
made.
Modifier and Type | Class and Description |
---|---|
static class |
RouteOptions.Builder
This builder can be used to set the values describing the
RouteOptions . |
Constructor and Description |
---|
RouteOptions() |
Modifier and Type | Method and Description |
---|---|
abstract java.lang.String |
accessToken()
A valid Mapbox access token used to making the request.
|
abstract java.lang.Boolean |
alternatives()
The same alternative setting which were used during the request that resulted in this root
directions response.
|
abstract java.lang.String |
annotations()
The same annotations in String format which were used during the request that resulted in this
root directions response.
|
abstract java.lang.Boolean |
bannerInstructions()
Whether or not the request had banner instructions set to true or not.
|
abstract java.lang.String |
baseUrl()
The same base URL which was used during the request that resulted in this root directions
response.
|
abstract java.lang.String |
bearings()
The same bearings which were used during the request that resulted in this root directions
response.
|
static RouteOptions.Builder |
builder()
Build a new instance of this RouteOptions class optionally settling values.
|
abstract java.lang.Boolean |
continueStraight()
The same continueStraight setting which was used during the request that resulted in this root
directions response.
|
abstract java.util.List<com.mapbox.geojson.Point> |
coordinates()
The coordinates used for the routes origin, destination, and optionally, waypoints.
|
abstract java.lang.String |
exclude()
The same exclusions the user originally made when the request was made.
|
abstract java.lang.String |
language()
The same language which was used during the request that resulted in this root directions
response.
|
abstract java.lang.String |
profile()
The same profile which was used during the request that resulted in this root directions
response.
|
abstract java.lang.String |
radiuses()
The same radiuses were used during the request that resulted in this root directions response.
|
abstract java.lang.String |
requestUuid()
A universally unique identifier (UUID) for identifying and executing a similar specific route
in the future.
|
static com.google.gson.TypeAdapter<RouteOptions> |
typeAdapter(com.google.gson.Gson gson)
Gson type adapter for parsing Gson to this class.
|
abstract java.lang.String |
user()
The same user which was used during the request that resulted in this root directions response.
|
abstract java.lang.Boolean |
voiceInstructions()
Whether or not the request had voice instructions set to true or not.
|
abstract java.lang.String |
voiceUnits()
Whether or not the units used inside the voice instruction's string are in imperial or metric.
|
public static RouteOptions.Builder builder()
RouteOptions.Builder
@NonNull public abstract java.lang.String baseUrl()
@NonNull public abstract java.lang.String user()
@NonNull public abstract java.lang.String profile()
MapboxDirections.builder()
ensures that a profile is always set even if the
MapboxDirections
requesting object doesn't specifically set a profile.@NonNull public abstract java.util.List<com.mapbox.geojson.Point> coordinates()
DirectionsWaypoint
s in
that these are the non-snapped coordinates.Point
s which represent the route origin, destination,
and optionally, waypoints@Nullable public abstract java.lang.Boolean alternatives()
@Nullable public abstract java.lang.String language()
@Nullable public abstract java.lang.String radiuses()
@Nullable public abstract java.lang.String bearings()
@Nullable public abstract java.lang.Boolean continueStraight()
@Nullable public abstract java.lang.String annotations()
@Nullable public abstract java.lang.String exclude()
DirectionsCriteria
exclusions@Nullable public abstract java.lang.Boolean voiceInstructions()
@Nullable public abstract java.lang.Boolean bannerInstructions()
@Nullable public abstract java.lang.String voiceUnits()
@NonNull public abstract java.lang.String accessToken()
@NonNull public abstract java.lang.String requestUuid()
MapboxDirections
always waits for the response object which ensures this
value will never be null.public static com.google.gson.TypeAdapter<RouteOptions> typeAdapter(com.google.gson.Gson gson)
gson
- the built Gson
object