public abstract class BannerComponents extends DirectionsJsonObject implements java.lang.Comparable<BannerComponents>
BannerText
which includes a snippet of the full banner text instruction. In
cases where data is avaliable, an image url will be provided to visually include a road shield.
To receive this information, your request must have MapboxDirections.bannerInstructions()
set to true.Modifier and Type | Class and Description |
---|---|
static class |
BannerComponents.Builder
This builder can be used to set the values describing the
BannerComponents . |
Constructor and Description |
---|
BannerComponents() |
Modifier and Type | Method and Description |
---|---|
abstract java.lang.String |
abbreviation()
The abbreviated form of text.
|
abstract java.lang.Integer |
abbreviationPriority()
An integer indicating the order in which the abbreviation abbr should be used in
place of text.
|
abstract java.lang.Boolean |
active()
A boolean telling you if that lane can be used to complete the upcoming maneuver.
|
static BannerComponents.Builder |
builder()
Create a new instance of this class by using the
BannerComponents.Builder class. |
int |
compareTo(BannerComponents bannerComponents)
Allows ability to sort/compare by abbreviation priority.
|
abstract java.util.List<java.lang.String> |
directions()
A List of directions indicating which way you can go from a lane
(left, right, or straight).
|
static BannerComponents |
fromJson(java.lang.String json)
Create a new instance of this class by passing in a formatted valid JSON String.
|
abstract java.lang.String |
imageBaseUrl()
In some cases when the
LegStep is a highway or major roadway, there might be a shield
icon that's included to better identify to your user to roadway. |
abstract java.lang.String |
text()
A snippet of the full
BannerText.text() which can be used for visually altering parts
of the full string. |
abstract BannerComponents.Builder |
toBuilder()
Convert the current
BannerComponents to its builder holding the currently assigned
values. |
abstract java.lang.String |
type()
String giving you more context about the component which may help in visual markup/display
choices.
|
static com.google.gson.TypeAdapter<BannerComponents> |
typeAdapter(com.google.gson.Gson gson)
Gson type adapter for parsing Gson to this class.
|
toJson
public static BannerComponents.Builder builder()
BannerComponents.Builder
class.BannerComponents.Builder
for creating a new instancepublic abstract java.lang.String text()
BannerText.text()
which can be used for visually altering parts
of the full string.public abstract java.lang.String type()
Possible values:
@Nullable @SerializedName(value="abbr") public abstract java.lang.String abbreviation()
If this is present, there will also be an abbr_priority value.
text()
.@Nullable @SerializedName(value="abbr_priority") public abstract java.lang.Integer abbreviationPriority()
Multiple components can have the same abbreviationPriority and when this happens all components with the same abbr_priority should be abbreviated at the same time. Finding no larger values of abbreviationPriority indicates that the string is fully abbreviated.
@Nullable @SerializedName(value="imageBaseURL") public abstract java.lang.String imageBaseUrl()
LegStep
is a highway or major roadway, there might be a shield
icon that's included to better identify to your user to roadway. Note that this doesn't
return the image itself but rather the url which can be used to download the file.@Nullable public abstract java.util.List<java.lang.String> directions()
@Nullable public abstract java.lang.Boolean active()
public abstract BannerComponents.Builder toBuilder()
BannerComponents
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 BannerComponents
.BannerComponents.Builder
with the same values set to match the ones defined
in this BannerComponents
public static com.google.gson.TypeAdapter<BannerComponents> typeAdapter(com.google.gson.Gson gson)
gson
- the built Gson
objectpublic static BannerComponents fromJson(java.lang.String json)
json
- a formatted valid JSON string defining a BannerComponentspublic int compareTo(BannerComponents bannerComponents)
compareTo
in interface java.lang.Comparable<BannerComponents>
bannerComponents
- to compare to