类 BannerComponents
java.lang.Object
ai.nextbillion.kits.directions.models.DirectionsJsonObject
ai.nextbillion.kits.directions.models.BannerComponents
- 所有已实现的接口:
Serializable,Comparable<BannerComponents>
public abstract class BannerComponents
extends DirectionsJsonObject
implements Comparable<BannerComponents>
A part of the
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
NbmapDirections.Builder#bannerInstructions() set to true.- 另请参阅:
-
嵌套类概要
嵌套类修饰符和类型类说明static @interfaceBanner component types.static @interfaceBanner component types.static classThis builder can be used to set the values describing theBannerComponents. -
字段概要
字段修饰符和类型字段说明static final StringThis is text that can be dropped, and should be dropped if you are rendering icons.static final StringProvides the the word for exit in the local language.static final StringIndicates the exit number for the maneuver.static final StringThis view gives guidance through junctions and is used to complete maneuvers.static final StringThis is text that can be replaced by an imageBaseURL icon.static final StringThis view gives guidance through junctions and is used to complete maneuvers.static final StringIndicates which lanes can be used to complete the maneuver.static final StringThis view gives guidance through signboards and is used to complete maneuvers.static final StringDefault. -
构造器概要
构造器 -
方法概要
修饰符和类型方法说明abstract StringThe abbreviated form of text.abstract IntegerAn integer indicating the order in which the abbreviation abbr should be used in place of text.abstract Booleanactive()A boolean telling you if that lane can be used to complete the upcoming maneuver.static BannerComponents.Builderbuilder()Create a new instance of this class by using theBannerComponents.Builderclass.intcompareTo(BannerComponents bannerComponents) Allows ability to sort/compare by abbreviation priority.abstract StringA string telling you of the local country codeA List of directions indicating which way you can go from a lane (left, right, or straight).static BannerComponentsCreate a new instance of this class by passing in a formatted valid JSON String.abstract StringIn some cases when theLegStepis a highway or major roadway, there might be a shield icon that's included to better identify to your user to roadway.abstract StringimageUrl()In some cases when theStepManeuverwill be difficult to navigate, an image can describe how to proceed.abstract StringA string telling you if there have a shield on the road It will be wrapped in a image and combine with the text and showing in the instructionabstract StringsubType()String giving you more context aboutBannerComponents.BannerComponentsTypewhich may help in visual markup/display choices.abstract Stringtext()A snippet of the fullBannerText.text()which can be used for visually altering parts of the full string.abstract BannerComponents.BuilderConvert the currentBannerComponentsto its builder holding the currently assigned values.abstract Stringtype()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.从类继承的方法 ai.nextbillion.kits.directions.models.DirectionsJsonObject
toJson
-
字段详细资料
-
TEXT
Default. Indicates the text is part of the instructions and no other type.- 另请参阅:
-
ICON
This is text that can be replaced by an imageBaseURL icon.- 另请参阅:
-
DELIMITER
This is text that can be dropped, and should be dropped if you are rendering icons.- 另请参阅:
-
EXIT_NUMBER
Indicates the exit number for the maneuver.- 另请参阅:
-
EXIT
Provides the the word for exit in the local language.- 另请参阅:
-
LANE
Indicates which lanes can be used to complete the maneuver.- 另请参阅:
-
GUIDANCE_VIEW
This view gives guidance through junctions and is used to complete maneuvers.- 另请参阅:
-
SIGNBOARD
This view gives guidance through signboards and is used to complete maneuvers.- 另请参阅:
-
JCT
This view gives guidance through junctions and is used to complete maneuvers.- 另请参阅:
-
-
构造器详细资料
-
BannerComponents
public BannerComponents()
-
-
方法详细资料
-
builder
Create a new instance of this class by using theBannerComponents.Builderclass.- 返回:
- this classes
BannerComponents.Builderfor creating a new instance
-
text
A snippet of the fullBannerText.text()which can be used for visually altering parts of the full string.- 返回:
- a single snippet of the full text instruction
-
type
String giving you more context about the component which may help in visual markup/display choices. If the type of the components is unknown it should be treated as text.Possible values:
- text (default): indicates the text is part of the instructions and no other type
- icon: this is text that can be replaced by an icon, see imageBaseURL
- delimiter: this is text that can be dropped and should be dropped if you are rendering icons
- exit-number: the exit number for the maneuver
- exit: the word for exit in the local language
- 返回:
- String type from above list
-
subType
String giving you more context aboutBannerComponents.BannerComponentsTypewhich may help in visual markup/display choices.Possible values:
- jct: indicates a junction guidance view.
- signboard: indicates a signboard guidance view.
- 返回:
- String type from above list
-
abbreviation
The abbreviated form of text.If this is present, there will also be an abbr_priority value.
- 返回:
- abbreviated form of
text().
-
abbreviationPriority
An integer indicating the order in which the abbreviation abbr should be used in place of text. The highest priority is 0 and a higher integer value indicates a lower priority. There are no gaps in integer values.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.
- 返回:
- Integer indicating the order of the abbreviation
-
imageBaseUrl
In some cases when theLegStepis 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.- 返回:
- the url which can be used to download the shield icon if one is available
-
imageUrl
In some cases when theStepManeuverwill 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.- 返回:
- the url which can be used to download the image.
-
directions
A List of directions indicating which way you can go from a lane (left, right, or straight). If the value is ['left', 'straight'], the driver can go straight or left from that lane. Present if this is a lane component.- 返回:
- List of allowed directions from that lane.
-
active
A boolean telling you if that lane can be used to complete the upcoming maneuver. If multiple lanes are active, then they can all be used to complete the upcoming maneuver. Present if this is a lane component.- 返回:
- List of allowed directions from that lane.
-
reference
A string telling you if there have a shield on the road It will be wrapped in a image and combine with the text and showing in the instruction- 返回:
- string of the shield name
-
countryCode
A string telling you of the local country code- 返回:
- country
-
toBuilder
Convert the currentBannerComponentsto 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 modifiedBannerComponents.- 返回:
- a
BannerComponents.Builderwith the same values set to match the ones defined in thisBannerComponents
-
typeAdapter
Gson type adapter for parsing Gson to this class.- 参数:
gson- the builtGsonobject- 返回:
- the type adapter for this class
-
fromJson
Create a new instance of this class by passing in a formatted valid JSON String.- 参数:
json- a formatted valid JSON string defining a BannerComponents- 返回:
- a new instance of this class defined by the values passed inside this static factory method
-
compareTo
Allows ability to sort/compare by abbreviation priority. This is null-safe for values of abbreviationPriority, and treats BannerComponents with a null abreviationPriority as having an abbreviationPriority of infinity. This method returns a negative integer, zero, or a positive integer as this object is less than, equal to, or greater than the specified object.- 指定者:
compareTo在接口中Comparable<BannerComponents>- 参数:
bannerComponents- to compare to- 返回:
- the compareTo int value
-