-
Notifications
You must be signed in to change notification settings - Fork 120
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
added traffic tendecy #1479
Merged
Merged
added traffic tendecy #1479
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
package com.mapbox.api.directions.v5; | ||
|
||
import androidx.annotation.IntDef; | ||
import androidx.annotation.StringDef; | ||
|
||
import java.lang.annotation.Retention; | ||
|
@@ -143,6 +144,13 @@ public final class DirectionsCriteria { | |
*/ | ||
public static final String ANNOTATION_CLOSURE = "closure"; | ||
|
||
/* | ||
* The tendency value conveys the changing | ||
* state of traffic congestion (increasing, decreasing, constant etc). | ||
*/ | ||
@SuppressWarnings("checkstyle:javadocvariable") | ||
public static final String ANNOTATION_TRAFFIC_TENDENCY = "traffic_tendency"; | ||
|
||
/** | ||
* Exclude all tolls along the returned directions route. | ||
* | ||
|
@@ -270,6 +278,42 @@ public final class DirectionsCriteria { | |
*/ | ||
public static final String APPROACH_CURB = "curb"; | ||
|
||
/* | ||
* Conveys the changing state of traffic congestion: unknown. | ||
*/ | ||
@SuppressWarnings("checkstyle:javadocvariable") | ||
public static final int TRAFFIC_TENDENCY_UNKNOWN = 0; | ||
|
||
/* | ||
* Conveys the changing state of traffic congestion: constant. | ||
*/ | ||
@SuppressWarnings("checkstyle:javadocvariable") | ||
public static final int TRAFFIC_TENDENCY_CONSTANT_CONGESTION = 1; | ||
|
||
/* | ||
* Conveys the changing state of traffic congestion: increasing. | ||
*/ | ||
@SuppressWarnings("checkstyle:javadocvariable") | ||
public static final int TRAFFIC_TENDENCY_INCREASING_CONGESTION = 2; | ||
|
||
/* | ||
* Conveys the changing state of traffic congestion: decreasing. | ||
*/ | ||
@SuppressWarnings("checkstyle:javadocvariable") | ||
public static final int TRAFFIC_TENDENCY_DECREASING_CONGESTION = 3; | ||
|
||
/* | ||
* Conveys the changing state of traffic congestion: rapidly increasing. | ||
*/ | ||
@SuppressWarnings("checkstyle:javadocvariable") | ||
public static final int TRAFFIC_TENDENCY_RAPIDLY_INCREASING_CONGESTION = 4; | ||
|
||
/* | ||
* Conveys the changing state of traffic congestion: rapidly decreasing. | ||
*/ | ||
@SuppressWarnings("checkstyle:javadocvariable") | ||
public static final int TRAFFIC_TENDENCY_RAPIDLY_DECREASING_CONGESTION = 5; | ||
|
||
private DirectionsCriteria() { | ||
//not called | ||
} | ||
|
@@ -329,7 +373,8 @@ private DirectionsCriteria() { | |
ANNOTATION_CONGESTION, | ||
ANNOTATION_CONGESTION_NUMERIC, | ||
ANNOTATION_MAXSPEED, | ||
ANNOTATION_CLOSURE | ||
ANNOTATION_CLOSURE, | ||
ANNOTATION_TRAFFIC_TENDENCY | ||
}) | ||
public @interface AnnotationCriteria { | ||
} | ||
|
@@ -417,4 +462,23 @@ private DirectionsCriteria() { | |
}) | ||
public @interface ApproachesCriteria { | ||
} | ||
|
||
/* | ||
* Retention policy for the traffic tendency annotations. | ||
* The tendency value conveys the changing state of traffic | ||
* congestion (increasing, decreasing, constant etc). New values | ||
* could be introduced in the future without an API version change. | ||
*/ | ||
@SuppressWarnings("checkstyle:javadoctype") | ||
@Retention(RetentionPolicy.CLASS) | ||
@IntDef({ | ||
TRAFFIC_TENDENCY_UNKNOWN, | ||
TRAFFIC_TENDENCY_CONSTANT_CONGESTION, | ||
TRAFFIC_TENDENCY_INCREASING_CONGESTION, | ||
TRAFFIC_TENDENCY_DECREASING_CONGESTION, | ||
TRAFFIC_TENDENCY_RAPIDLY_INCREASING_CONGESTION, | ||
TRAFFIC_TENDENCY_RAPIDLY_DECREASING_CONGESTION | ||
}) | ||
public @interface TrafficTendencyCriteria { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is the annotation used anywhere? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. only in comments |
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should it be here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes