类 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.
另请参阅:
  • 字段详细资料

    • TEXT

      public static final String TEXT
      Default. Indicates the text is part of the instructions and no other type.
      另请参阅:
    • ICON

      public static final String ICON
      This is text that can be replaced by an imageBaseURL icon.
      另请参阅:
    • DELIMITER

      public static final String DELIMITER
      This is text that can be dropped, and should be dropped if you are rendering icons.
      另请参阅:
    • EXIT_NUMBER

      public static final String EXIT_NUMBER
      Indicates the exit number for the maneuver.
      另请参阅:
    • EXIT

      public static final String EXIT
      Provides the the word for exit in the local language.
      另请参阅:
    • LANE

      public static final String LANE
      Indicates which lanes can be used to complete the maneuver.
      另请参阅:
    • GUIDANCE_VIEW

      public static final String GUIDANCE_VIEW
      This view gives guidance through junctions and is used to complete maneuvers.
      另请参阅:
    • SIGNBOARD

      public static final String SIGNBOARD
      This view gives guidance through signboards and is used to complete maneuvers.
      另请参阅:
    • JCT

      public static final String JCT
      This view gives guidance through junctions and is used to complete maneuvers.
      另请参阅:
  • 构造器详细资料

    • BannerComponents

      public BannerComponents()
  • 方法详细资料

    • builder

      public static BannerComponents.Builder builder()
      Create a new instance of this class by using the BannerComponents.Builder class.
      返回:
      this classes BannerComponents.Builder for creating a new instance
    • text

      @NonNull public abstract String text()
      A snippet of the full BannerText.text() which can be used for visually altering parts of the full string.
      返回:
      a single snippet of the full text instruction
    • type

      @NonNull public abstract String 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

      @Nullable public abstract String subType()
      String giving you more context about BannerComponents.BannerComponentsType which 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

      @Nullable @SerializedName("abbr") public abstract String abbreviation()
      The abbreviated form of text.

      If this is present, there will also be an abbr_priority value.

      返回:
      abbreviated form of text().
    • abbreviationPriority

      @Nullable @SerializedName("abbr_priority") public abstract Integer 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

      @Nullable @SerializedName("imageBaseURL") public abstract 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. 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

      @Nullable @SerializedName("imageURL") public abstract String imageUrl()
      In some cases when the 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.
      返回:
      the url which can be used to download the image.
    • directions

      @Nullable public abstract List<String> 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

      @Nullable public abstract Boolean 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

      @Nullable public abstract String 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

      @Nullable public abstract String countryCode()
      A string telling you of the local country code
      返回:
      country
    • toBuilder

      public abstract BannerComponents.Builder toBuilder()
      Convert the current 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.
      返回:
      a BannerComponents.Builder with the same values set to match the ones defined in this BannerComponents
    • typeAdapter

      public static com.google.gson.TypeAdapter<BannerComponents> typeAdapter(com.google.gson.Gson gson)
      Gson type adapter for parsing Gson to this class.
      参数:
      gson - the built Gson object
      返回:
      the type adapter for this class
    • fromJson

      public static BannerComponents fromJson(String json)
      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

      public int compareTo(BannerComponents bannerComponents)
      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