|
1 | 1 | package com.mapbox.api.directions.v5; |
2 | 2 |
|
| 3 | +import androidx.annotation.IntDef; |
3 | 4 | import androidx.annotation.StringDef; |
4 | 5 |
|
5 | 6 | import java.lang.annotation.Retention; |
@@ -143,6 +144,12 @@ public final class DirectionsCriteria { |
143 | 144 | */ |
144 | 145 | public static final String ANNOTATION_CLOSURE = "closure"; |
145 | 146 |
|
| 147 | + /** |
| 148 | + * The tendency value conveys the changing |
| 149 | + * state of traffic congestion (increasing, decreasing, constant etc). |
| 150 | + */ |
| 151 | + public static final String ANNOTATION_TRAFFIC_TENDENCY = "traffic_tendency"; |
| 152 | + |
146 | 153 | /** |
147 | 154 | * Exclude all tolls along the returned directions route. |
148 | 155 | * |
@@ -270,6 +277,36 @@ public final class DirectionsCriteria { |
270 | 277 | */ |
271 | 278 | public static final String APPROACH_CURB = "curb"; |
272 | 279 |
|
| 280 | + /*** |
| 281 | + * Conveys the changing state of traffic congestion: unknown. |
| 282 | + */ |
| 283 | + public static final int TRAFFIC_TENDENCY_UNKNOWN = 0; |
| 284 | + |
| 285 | + /*** |
| 286 | + * Conveys the changing state of traffic congestion: constant. |
| 287 | + */ |
| 288 | + public static final int TRAFFIC_TENDENCY_CONSTANT_CONGESTION = 1; |
| 289 | + |
| 290 | + /*** |
| 291 | + * Conveys the changing state of traffic congestion: increasing. |
| 292 | + */ |
| 293 | + public static final int TRAFFIC_TENDENCY_INCREASING_CONGESTION = 2; |
| 294 | + |
| 295 | + /*** |
| 296 | + * Conveys the changing state of traffic congestion: decreasing. |
| 297 | + */ |
| 298 | + public static final int TRAFFIC_TENDENCY_DECREASING_CONGESTION = 3; |
| 299 | + |
| 300 | + /*** |
| 301 | + * Conveys the changing state of traffic congestion: rapidly increasing. |
| 302 | + */ |
| 303 | + public static final int TRAFFIC_TENDENCY_RAPIDLY_INCREASING_CONGESTION = 4; |
| 304 | + |
| 305 | + /*** |
| 306 | + * Conveys the changing state of traffic congestion: rapidly decreasing. |
| 307 | + */ |
| 308 | + public static final int TRAFFIC_TENDENCY_RAPIDLY_DECREASING_CONGESTION = 5; |
| 309 | + |
273 | 310 | private DirectionsCriteria() { |
274 | 311 | //not called |
275 | 312 | } |
@@ -329,7 +366,8 @@ private DirectionsCriteria() { |
329 | 366 | ANNOTATION_CONGESTION, |
330 | 367 | ANNOTATION_CONGESTION_NUMERIC, |
331 | 368 | ANNOTATION_MAXSPEED, |
332 | | - ANNOTATION_CLOSURE |
| 369 | + ANNOTATION_CLOSURE, |
| 370 | + ANNOTATION_TRAFFIC_TENDENCY |
333 | 371 | }) |
334 | 372 | public @interface AnnotationCriteria { |
335 | 373 | } |
@@ -417,4 +455,22 @@ private DirectionsCriteria() { |
417 | 455 | }) |
418 | 456 | public @interface ApproachesCriteria { |
419 | 457 | } |
| 458 | + |
| 459 | + /** |
| 460 | + * Retention policy for the traffic tendency annotations. |
| 461 | + * The tendency value conveys the changing state of traffic |
| 462 | + * congestion (increasing, decreasing, constant etc). New values |
| 463 | + * could be introduced in the future without an API version change. |
| 464 | + */ |
| 465 | + @Retention(RetentionPolicy.CLASS) |
| 466 | + @IntDef({ |
| 467 | + TRAFFIC_TENDENCY_UNKNOWN, |
| 468 | + TRAFFIC_TENDENCY_CONSTANT_CONGESTION, |
| 469 | + TRAFFIC_TENDENCY_INCREASING_CONGESTION, |
| 470 | + TRAFFIC_TENDENCY_DECREASING_CONGESTION, |
| 471 | + TRAFFIC_TENDENCY_RAPIDLY_INCREASING_CONGESTION, |
| 472 | + TRAFFIC_TENDENCY_RAPIDLY_DECREASING_CONGESTION |
| 473 | + }) |
| 474 | + public @interface TrafficTendencyCriteria { |
| 475 | + } |
420 | 476 | } |
0 commit comments