public abstract class RouteOptions extends DirectionsJsonObject
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.String |
approaches()
Indicates from which side of the road to approach a waypoint.
|
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.
|
static RouteOptions |
fromJson(java.lang.String json)
Create a new instance of this class by passing in a formatted valid JSON String.
|
abstract java.lang.String |
geometries()
Geometry type used to make the initial directions request.
|
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 |
overview()
Type of returned overview geometry that was used to make the initial directions request.
|
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.
|
abstract java.lang.Boolean |
roundaboutExits()
This is set to true if you want to enable instructions while exiting roundabouts
and rotaries.
|
abstract java.lang.Boolean |
steps()
Boolean value used to determine whether to return steps and turn-by-turn instructions in the
initial directions request.
|
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.
|
abstract java.lang.String |
waypointNames()
Custom names for waypoints used for the arrival instruction in banners and voice instructions,
each separated by ; .
|
toJson
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()
@SerializedName(value="continue_straight") @Nullable public abstract java.lang.Boolean continueStraight()
@SerializedName(value="roundabout_exits") @Nullable public abstract java.lang.Boolean roundaboutExits()
public abstract java.lang.String geometries()
@Nullable public abstract java.lang.String overview()
DirectionsCriteria.OverviewCriteria
@Nullable public abstract java.lang.Boolean steps()
@Nullable public abstract java.lang.String annotations()
@Nullable public abstract java.lang.String exclude()
DirectionsCriteria
exclusions@SerializedName(value="voice_instructions") @Nullable public abstract java.lang.Boolean voiceInstructions()
@SerializedName(value="banner_instructions") @Nullable public abstract java.lang.Boolean bannerInstructions()
@SerializedName(value="voice_units") @Nullable public abstract java.lang.String voiceUnits()
@SerializedName(value="access_token") @NonNull public abstract java.lang.String accessToken()
@SerializedName(value="uuid") @NonNull public abstract java.lang.String requestUuid()
MapboxDirections
always waits for the response object which ensures this
value will never be null.@Nullable public abstract java.lang.String approaches()
@SerializedName(value="waypoint_names") @Nullable public abstract java.lang.String waypointNames()
public static com.google.gson.TypeAdapter<RouteOptions> typeAdapter(com.google.gson.Gson gson)
gson
- the built Gson
objectpublic static RouteOptions fromJson(java.lang.String json)
json
- a formatted valid JSON string defining a RouteOptions