Skip to content

Commit bba2a62

Browse files
authored
DirectionRoute: added durationTypical for Route, Leg and Step; VERSION_NAME: updated to 5.4.1-SNAPSHOT (#1172)
1 parent aa126fc commit bba2a62

4 files changed

Lines changed: 77 additions & 1 deletion

File tree

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Project-wide Gradle settings.
2-
VERSION_NAME=5.1.0-SNAPSHOT
2+
VERSION_NAME=5.4.1-SNAPSHOT
33

44
# Specifies the JVM arguments used for the daemon process.
55
# The setting is particularly useful for tweaking memory settings.

services-directions-models/src/main/java/com/mapbox/api/directions/v5/models/DirectionsRoute.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,19 @@ public static Builder builder() {
5959
@NonNull
6060
public abstract Double duration();
6161

62+
/**
63+
* The typical travel time from this route's origin to destination. There's a delay along
64+
* this route if you subtract this durationTypical() value from the route's duration()
65+
* value and the resulting difference is greater than 0. The delay is because of any
66+
* number of real-world situations (road repair, traffic jam, etc).
67+
*
68+
* @return a double number with unit seconds
69+
* @since 5.5.0
70+
*/
71+
@Nullable
72+
@SerializedName("duration_typical")
73+
public abstract Double durationTypical();
74+
6275
/**
6376
* Gives the geometry of the route. Commonly used to draw the route on the map view.
6477
*
@@ -185,6 +198,18 @@ public abstract static class Builder {
185198
*/
186199
public abstract Builder duration(@NonNull Double duration);
187200

201+
/**
202+
* The typical travel time from this route's origin to destination. There's a delay along
203+
* this route if you subtract this durationTypical() value from the route's duration()
204+
* value and the resulting difference is greater than 0. The delay is because of any
205+
* number of real-world situations (road repair, traffic jam, etc).
206+
*
207+
* @param durationTypical a double number with unit seconds
208+
* @return this builder for chaining options together
209+
* @since 5.5.0
210+
*/
211+
public abstract Builder durationTypical(@Nullable Double durationTypical);
212+
188213
/**
189214
* Gives the geometry of the route. Commonly used to draw the route on the map view.
190215
*

services-directions-models/src/main/java/com/mapbox/api/directions/v5/models/LegStep.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,19 @@ public static Builder builder() {
4646
*/
4747
public abstract double duration();
4848

49+
/**
50+
* The typical travel time for traversing this LegStep. There's a delay along the LegStep
51+
* if you subtract this durationTypical() value from the LegStep duration() value and
52+
* the resulting difference is greater than 0. The delay is because of any number
53+
* of real-world situations (road repair, traffic jam, etc).
54+
*
55+
* @return a double number with unit seconds
56+
* @since 5.5.0
57+
*/
58+
@Nullable
59+
@SerializedName("duration_typical")
60+
public abstract Double durationTypical();
61+
4962
/**
5063
* Gives the geometry of the leg step.
5164
*
@@ -263,6 +276,18 @@ public abstract static class Builder {
263276
*/
264277
public abstract Builder duration(double duration);
265278

279+
/**
280+
* The typical travel time for traversing this LegStep. There's a delay along the LegStep
281+
* if you subtract this durationTypical() value from the LegStep duration() value and
282+
* the resulting difference is greater than 0. The delay is because of any number
283+
* of real-world situations (road repair, traffic jam, etc).
284+
*
285+
* @param durationTypical a double number with unit seconds
286+
* @return this builder for chaining options together
287+
* @since 5.5.0
288+
*/
289+
public abstract Builder durationTypical(@Nullable Double durationTypical);
290+
266291
/**
267292
* Gives the geometry of the leg step.
268293
*

services-directions-models/src/main/java/com/mapbox/api/directions/v5/models/RouteLeg.java

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import com.google.gson.Gson;
66
import com.google.gson.GsonBuilder;
77
import com.google.gson.TypeAdapter;
8+
import com.google.gson.annotations.SerializedName;
89
import com.mapbox.api.directions.v5.DirectionsAdapterFactory;
910

1011
import java.util.List;
@@ -45,6 +46,19 @@ public static Builder builder() {
4546
@Nullable
4647
public abstract Double duration();
4748

49+
/**
50+
* The typical travel time for traversing this RouteLeg. There's a delay along the RouteLeg
51+
* if you subtract this durationTypical() value from the RouteLeg duration() value and
52+
* the resulting difference is greater than 0. The delay is because of any number
53+
* of real-world situations (road repair, traffic jam, etc).
54+
*
55+
* @return a double number with unit seconds
56+
* @since 5.5.0
57+
*/
58+
@Nullable
59+
@SerializedName("duration_typical")
60+
public abstract Double durationTypical();
61+
4862
/**
4963
* A short human-readable summary of major roads traversed. Useful to distinguish alternatives.
5064
*
@@ -137,6 +151,18 @@ public abstract static class Builder {
137151
*/
138152
public abstract Builder duration(@Nullable Double duration);
139153

154+
/**
155+
* The typical travel time for traversing this RouteLeg. There's a delay along the RouteLeg
156+
* if you subtract this durationTypical() value from the RouteLeg duration() value and
157+
* the resulting difference is greater than 0. The delay is because of any number
158+
* of real-world situations (road repair, traffic jam, etc).
159+
*
160+
* @param durationTypical a double number with unit seconds
161+
* @return this builder for chaining options together
162+
* @since 5.5.0
163+
*/
164+
public abstract Builder durationTypical(@Nullable Double durationTypical);
165+
140166
/**
141167
* A short human-readable summary of major roads traversed. Useful to distinguish alternatives.
142168
*

0 commit comments

Comments
 (0)