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()
Whether to try to return alternative routes (true) or not (false, default).
|
abstract java.lang.String |
annotations()
A comma-separated list of annotations.
|
java.util.List<java.lang.String> |
annotationsList()
A list of annotations.
|
abstract java.lang.String |
approaches()
Indicates from which side of the road to approach a waypoint.
|
java.util.List<java.lang.String> |
approachesList()
Indicates from which side of the road to approach a waypoint.
|
abstract java.lang.Boolean |
bannerInstructions()
Whether to return banner objects associated with the route steps (true) or not
(false, default).
|
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()
Influences the direction in which a route starts from a waypoint.
|
java.util.List<java.util.List<java.lang.Double>> |
bearingsList()
Influences the direction in which a route starts from a waypoint.
|
static RouteOptions.Builder |
builder()
Build a new instance of this RouteOptions class optionally settling values.
|
abstract java.lang.Boolean |
continueStraight()
The allowed direction of travel when departing intermediate waypoints.
|
abstract java.util.List<com.mapbox.geojson.Point> |
coordinates()
A list of Points to visit in order.
|
abstract java.lang.String |
exclude()
Exclude certain road types from routing.
|
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()
The format of the returned geometry.
|
abstract java.lang.String |
language()
The language of returned turn-by-turn text instructions.
|
abstract java.lang.String |
overview()
Displays the requested type of overview geometry.
|
abstract java.lang.String |
profile()
The routing profile to use.
|
abstract java.lang.String |
radiuses()
The maximum distance a coordinate can be moved to snap to the road network in meters.
|
java.util.List<java.lang.Double> |
radiusesList()
The maximum distance a coordinate can be moved to snap to the road network in meters.
|
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()
Whether to emit instructions at roundabout exits (true) or not (false, default).
|
abstract java.lang.Boolean |
steps()
Whether to return steps and turn-by-turn instructions (true) or not (false, default).
|
abstract RouteOptions.Builder |
toBuilder()
Convert the current
RouteOptions to its builder holding the currently assigned
values. |
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 to return SSML marked-up text for voice guidance along the route (true) or not
(false, default).
|
abstract java.lang.String |
voiceUnits()
A type of units to return in the text for voice instructions.
|
abstract WalkingOptions |
walkingOptions()
To be used to specify settings for use with the walking profile.
|
abstract java.lang.String |
waypointIndices()
Indicates which input coordinates should be treated as waypoints.
|
java.util.List<java.lang.Integer> |
waypointIndicesList()
Indicates which input coordinates should be treated as waypoints.
|
abstract java.lang.String |
waypointNames()
A semicolon-separated list of custom names for entries in the list of
coordinates(), used for the arrival instruction in banners and voice
instructions. |
java.util.List<java.lang.String> |
waypointNamesList()
A semicolon-separated list of custom names for entries in the list of
coordinates(), used for the arrival instruction in banners and voice
instructions. |
abstract java.lang.String |
waypointTargets()
A semicolon-separated list of coordinate pairs used to specify drop-off
locations that are distinct from the locations specified in coordinates.
|
java.util.List<com.mapbox.geojson.Point> |
waypointTargetsList()
A list of points used to specify drop-off
locations that are distinct from the locations specified in coordinates.
|
toJsonpublic 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()
DirectionsCriteria.PROFILE_DRIVING_TRAFFIC, DirectionsCriteria.PROFILE_DRIVING,
DirectionsCriteria.PROFILE_WALKING, or DirectionsCriteria.PROFILE_CYCLING.
The same profile which was used during the request that resulted in this root directions
response. MapboxDirections.Builder ensures that a profile is always set even if the
MapboxDirections requesting object doesn't specifically set a profile.DirectionsCriteria.ProfileCriteria@NonNull public abstract java.util.List<com.mapbox.geojson.Point> coordinates()
DirectionsCriteria.PROFILE_DRIVING_TRAFFIC requests.
Note that these coordinates are different than the direction responses
DirectionsWaypoints that these are the non-snapped coordinates.Points which represent the route origin, destination,
and optionally, waypoints@Nullable public abstract java.lang.Boolean alternatives()
DirectionsCriteria.PROFILE_DRIVING_TRAFFIC,
DirectionsCriteria.PROFILE_DRIVING, DirectionsCriteria.PROFILE_CYCLING.@Nullable public abstract java.lang.String language()
RouteOptions.Builder.steps(Boolean).@Nullable public abstract java.lang.String radiuses()
@Nullable public java.util.List<java.lang.Double> radiusesList()
@Nullable public abstract java.lang.String bearings()
@Nullable public java.util.List<java.util.List<java.lang.Double>> bearingsList()
@SerializedName(value="continue_straight") @Nullable public abstract java.lang.Boolean continueStraight()
DirectionsCriteria.PROFILE_DRIVING and false
for DirectionsCriteria.PROFILE_WALKING and DirectionsCriteria.PROFILE_CYCLING.@SerializedName(value="roundabout_exits") @Nullable public abstract java.lang.Boolean roundaboutExits()
steps()=true.@Nullable public abstract java.lang.String geometries()
DirectionsCriteria.GEOMETRY_POLYLINE (default, a polyline with a precision of five
decimal places), DirectionsCriteria.GEOMETRY_POLYLINE6 (a polyline with a precision
of six decimal places).DirectionsCriteria.GeometriesCriteria.@Nullable public abstract java.lang.String overview()
DirectionsCriteria.OVERVIEW_FULL (the most detailed geometry
available), DirectionsCriteria.OVERVIEW_SIMPLIFIED (default, a simplified version of
the full geometry), or DirectionsCriteria.OVERVIEW_FALSE (no overview geometry).DirectionsCriteria.OverviewCriteria@Nullable public abstract java.lang.Boolean steps()
bannerInstructions(), language(),
roundaboutExits(), voiceInstructions(),
voiceUnits(), waypointNamesList(),
waypointTargetsList(), waypoints from coordinates()@Nullable public abstract java.lang.String annotations()
DirectionsCriteria.ANNOTATION_DURATION
DirectionsCriteria.ANNOTATION_DISTANCE
DirectionsCriteria.ANNOTATION_SPEED
DirectionsCriteria.ANNOTATION_CONGESTION
DirectionsCriteria.ANNOTATION_MAXSPEED
See the RouteLeg object for more details on what is included with annotations.
Must be used in conjunction with overview=full.@Nullable public java.util.List<java.lang.String> annotationsList()
DirectionsCriteria.ANNOTATION_DURATION
DirectionsCriteria.ANNOTATION_DISTANCE
DirectionsCriteria.ANNOTATION_SPEED
DirectionsCriteria.ANNOTATION_CONGESTION
DirectionsCriteria.ANNOTATION_MAXSPEED
See the RouteLeg object for more details on what is included with annotations.
Must be used in conjunction with overview=full.@Nullable public abstract java.lang.String exclude()
DirectionsCriteria.PROFILE_DRIVING: One of DirectionsCriteria.EXCLUDE_TOLL,
DirectionsCriteria.EXCLUDE_MOTORWAY, or DirectionsCriteria.EXCLUDE_FERRY.
DirectionsCriteria.PROFILE_DRIVING_TRAFFIC: One of
DirectionsCriteria.EXCLUDE_TOLL, DirectionsCriteria.EXCLUDE_MOTORWAY, or
DirectionsCriteria.EXCLUDE_FERRY.
DirectionsCriteria.PROFILE_WALKING: No excludes supported
DirectionsCriteria.PROFILE_CYCLING: DirectionsCriteria.EXCLUDE_FERRYDirectionsCriteria.ExcludeCriteria exclusions@SerializedName(value="voice_instructions") @Nullable public abstract java.lang.Boolean voiceInstructions()
steps()=true.@SerializedName(value="banner_instructions") @Nullable public abstract java.lang.Boolean bannerInstructions()
steps()=true@SerializedName(value="voice_units") @Nullable public abstract java.lang.String voiceUnits()
DirectionsCriteria.IMPERIAL (default) or DirectionsCriteria.METRIC.
Must be used in conjunction with steps()=true and
voiceInstructions() ()}=true.@SerializedName(value="access_token") @NonNull public abstract java.lang.String accessToken()
@SerializedName(value="uuid") @Nullable public abstract java.lang.String requestUuid()
@Nullable public abstract java.lang.String approaches()
DirectionsCriteria.APPROACH_UNRESTRICTED (default) or
DirectionsCriteria.APPROACH_CURB .
If set to DirectionsCriteria.APPROACH_UNRESTRICTED, the route can approach waypoints
from either side of the road.
If set to DirectionsCriteria.APPROACH_CURB, the route will be returned so that on
arrival, the waypoint will be found on the side that corresponds with the driving_side of the
region in which the returned route is located.
If provided, the list of approaches must be the same length as the list of waypoints.@Nullable public java.util.List<java.lang.String> approachesList()
DirectionsCriteria.APPROACH_UNRESTRICTED (default) or
DirectionsCriteria.APPROACH_CURB .
If set to DirectionsCriteria.APPROACH_UNRESTRICTED, the route can approach waypoints
from either side of the road.
If set to DirectionsCriteria.APPROACH_CURB, the route will be returned so that on
arrival, the waypoint will be found on the side that corresponds with the driving_side of the
region in which the returned route is located.
If provided, the list of approaches must be the same length as the list of waypoints.@SerializedName(value="waypoints") @Nullable public abstract java.lang.String waypointIndices()
Most useful in combination with steps=true and requests based on traces
with high sample rates. Can be an index corresponding to any of the input coordinates,
but must contain the first ( 0 ) and last coordinates' index separated by ; .
steps()
@Nullable public java.util.List<java.lang.Integer> waypointIndicesList()
Most useful in combination with steps=true and requests based on traces
with high sample rates. Can be an index corresponding to any of the input coordinates,
but must contain the first ( 0 ) and last coordinates' index.
steps()
@SerializedName(value="waypoint_names") @Nullable public abstract java.lang.String waypointNames()
coordinates(), used for the arrival instruction in banners and voice
instructions. Values can be any string, and the total number of all characters cannot exceed
500. If provided, the list of waypoint_names must be the same length as the list of
coordinates. The first value in the list corresponds to the route origin, not the first
destination.
Must be used in conjunction with steps() = true.@Nullable public java.util.List<java.lang.String> waypointNamesList()
coordinates(), used for the arrival instruction in banners and voice
instructions. Values can be any string, and the total number of all characters cannot exceed
500. If provided, the list of waypoint_names must be the same length as the list of
coordinates. The first value in the list corresponds to the route origin, not the first
destination.
Must be used in conjunction with steps() = true.@SerializedName(value="waypoint_targets") @Nullable public abstract java.lang.String waypointTargets()
steps() = true.@Nullable public java.util.List<com.mapbox.geojson.Point> waypointTargetsList()
steps() = true.@Nullable public abstract WalkingOptions walkingOptions()
public static com.google.gson.TypeAdapter<RouteOptions> typeAdapter(com.google.gson.Gson gson)
gson - the built Gson object@NonNull public static RouteOptions fromJson(java.lang.String json)
json - a formatted valid JSON string defining a RouteOptions@NonNull public abstract RouteOptions.Builder toBuilder()
RouteOptions to its builder holding the currently assigned
values. This allows you to modify a single property and then rebuild the object resulting in
an updated and modified RouteOptions.RouteOptions.Builder with the same values set to match the ones defined
in this RouteOptions