11package com .mapbox .api .directions .v5 .models ;
22
3+ import android .support .annotation .NonNull ;
34import android .support .annotation .Nullable ;
45
56import com .google .auto .value .AutoValue ;
67import com .google .gson .Gson ;
78import com .google .gson .TypeAdapter ;
89import com .mapbox .api .directions .v5 .DirectionsCriteria ;
10+ import com .mapbox .api .directions .v5 .MapboxDirections ;
11+ import com .mapbox .geojson .Point ;
12+
13+ import java .util .List ;
914
1015/**
1116 * Provides information connected to your request that help when a new directions request is needing
@@ -41,21 +46,34 @@ public static Builder builder() {
4146 * @return string value representing the user
4247 * @since 3.0.0
4348 */
44- @ Nullable
49+ @ NonNull
4550 public abstract String user ();
4651
4752 /**
4853 * The same profile which was used during the request that resulted in this root directions
49- * response.
54+ * response. {@link MapboxDirections#builder()} ensures that a profile is always set even if the
55+ * {@link MapboxDirections} requesting object doesn't specifically set a profile.
5056 *
5157 * @return string value representing the profile
5258 * @since 3.0.0
5359 */
54- @ Nullable
60+ @ NonNull
5561 public abstract String profile ();
5662
5763 /**
58- * The same alternative setting which was used during the request that resulted in this root
64+ * The coordinates used for the routes origin, destination, and optionally, waypoints. Note that
65+ * these coordinates are different than the direction responses {@link DirectionsWaypoint}s in
66+ * that these are the non-snapped coordinates.
67+ *
68+ * @return a list of {@link Point}s which represent the route origin, destination, and optionally,
69+ * waypoints
70+ * @since 3.0.0
71+ */
72+ @ NonNull
73+ public abstract List <Point > coordinates ();
74+
75+ /**
76+ * The same alternative setting which were used during the request that resulted in this root
5977 * directions response.
6078 *
6179 * @return boolean object representing the setting for alternatives
@@ -143,12 +161,33 @@ public static Builder builder() {
143161 @ Nullable
144162 public abstract Boolean bannerInstructions ();
145163
164+ /**
165+ * Whether or not the units used inside the voice instruction's string are in imperial or metric.
166+ *
167+ * @return a string matching either imperial or metric
168+ * @since 3.0.0
169+ */
146170 @ Nullable
147171 public abstract String voiceUnits ();
148172
173+ /**
174+ * A valid Mapbox access token used to making the request.
175+ *
176+ * @return a string representing the Mapbox access token
177+ * @since 3.0.0
178+ */
179+ @ NonNull
149180 public abstract String accessToken ();
150181
151- @ Nullable
182+ /**
183+ * A universally unique identifier (UUID) for identifying and executing a similar specific route
184+ * in the future. {@link MapboxDirections} always waits for the response object which ensures this
185+ * value will never be null.
186+ *
187+ * @return a string containing the request UUID
188+ * @since 3.0.0
189+ */
190+ @ NonNull
152191 public abstract String requestUuid ();
153192
154193 /**
@@ -177,7 +216,7 @@ public abstract static class Builder {
177216 * @return this builder for chaining options together
178217 * @since 3.0.0
179218 */
180- public abstract Builder user (String user );
219+ public abstract Builder user (@ NonNull String user );
181220
182221 /**
183222 * The directions profile that was used during the request time and resulted in this responses
@@ -188,7 +227,19 @@ public abstract static class Builder {
188227 * @return this builder for chaining options together
189228 * @since 3.0.0
190229 */
191- public abstract Builder profile (@ Nullable @ DirectionsCriteria .ProfileCriteria String profile );
230+ public abstract Builder profile (@ NonNull @ DirectionsCriteria .ProfileCriteria String profile );
231+
232+ /**
233+ * The coordinates used for the routes origin, destination, and optionally, waypoints. Note that
234+ * these coordinates are different than the direction responses {@link DirectionsWaypoint}s in
235+ * that these are the non-snapped coordinates.
236+ *
237+ * @param coordinates a list of {@link Point}s which represent the route origin, destination,
238+ * and optionally, waypoints
239+ * @return this builder for chaining options together
240+ * @since 3.0.0
241+ */
242+ public abstract Builder coordinates (@ NonNull List <Point > coordinates );
192243
193244 /**
194245 * Whether the alternatives value was set to true or not.
@@ -197,7 +248,7 @@ public abstract static class Builder {
197248 * @return this builder for chaining options together
198249 * @since 3.0.0
199250 */
200- public abstract Builder alternatives (Boolean alternatives );
251+ public abstract Builder alternatives (@ Nullable Boolean alternatives );
201252
202253 /**
203254 * The language for instructions to be in when the response is given.
@@ -265,11 +316,33 @@ public abstract static class Builder {
265316 */
266317 public abstract Builder bannerInstructions (Boolean bannerInstructions );
267318
319+ /**
320+ * Whether or not the units used inside the voice instruction's string are in imperial or metric.
321+ *
322+ * @param voiceUnits string matching either imperial or metric
323+ * @return this builder for chaining options together
324+ * @since 3.0.0
325+ */
268326 public abstract Builder voiceUnits (@ Nullable String voiceUnits );
269327
270- public abstract Builder accessToken (String accessToken );
328+ /**
329+ * A valid Mapbox access token used to making the request.
330+ *
331+ * @param accessToken a string containing a valid Mapbox access token
332+ * @return this builder for chaining options together
333+ * @since 3.0.0
334+ */
335+ public abstract Builder accessToken (@ NonNull String accessToken );
271336
272- public abstract Builder requestUuid (String requestUuid );
337+ /**
338+ * A universally unique identifier (UUID) for identifying and executing a similar specific route
339+ * in the future.
340+ *
341+ * @param requestUuid a string containing the request UUID
342+ * @return this builder for chaining options together
343+ * @since 3.0.0
344+ */
345+ public abstract Builder requestUuid (@ NonNull String requestUuid );
273346
274347 /**
275348 * The same exclusions the user originally made when the request was made.
0 commit comments