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 available, an image url will be provided to visually include a road shield.
To receive this information, your request must have
MapboxDirections.Builder#bannerInstructions() set to true.| Modifier and Type | Class and Description |
|---|---|
static interface |
BannerComponents.BannerComponentsType
Banner component types.
|
static class |
BannerComponents.Builder
This builder can be used to set the values describing the
BannerComponents. |
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DELIMITER
This is text that can be dropped, and should be dropped if you are rendering icons.
|
static java.lang.String |
EXIT
Provides the the word for exit in the local language.
|
static java.lang.String |
EXIT_NUMBER
Indicates the exit number for the maneuver.
|
static java.lang.String |
GUIDANCE_VIEW
This view gives guidance through junctions and is used to complete maneuvers.
|
static java.lang.String |
ICON
This is text that can be replaced by an imageBaseURL icon.
|
static java.lang.String |
LANE
Indicates which lanes can be used to complete the maneuver.
|
static java.lang.String |
TEXT
Default.
|
| 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 |
imageUrl()
In some cases when the
StepManeuver will be difficult to navigate, an image
can describe how to proceed. |
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.
|
toJsonpublic static final java.lang.String TEXT
public static final java.lang.String ICON
public static final java.lang.String DELIMITER
public static final java.lang.String EXIT_NUMBER
public static final java.lang.String EXIT
public static final java.lang.String LANE
public static final java.lang.String GUIDANCE_VIEW
public static BannerComponents.Builder builder()
BannerComponents.Builder class.BannerComponents.Builder for creating a new instance@NonNull public abstract java.lang.String text()
BannerText.text() which can be used for visually altering parts
of the full string.@NonNull 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 @SerializedName(value="imageURL") public abstract java.lang.String imageUrl()
StepManeuver will be difficult to navigate, an image
can describe how to proceed. The domain name for this image is a Junction View.
Unlike the imageBaseUrl, this image url does not include image density encodings.@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 BannerComponentspublic 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