类 BannerComponents.Builder

java.lang.Object
ai.nextbillion.kits.directions.models.BannerComponents.Builder
封闭类:
BannerComponents

public abstract static class BannerComponents.Builder extends Object
This builder can be used to set the values describing the BannerComponents.
  • 构造器详细资料

    • Builder

      public Builder()
  • 方法详细资料

    • text

      public abstract BannerComponents.Builder text(@NonNull String text)
      A snippet of the full BannerText.text() which can be used for visually altering parts of the full string.
      参数:
      text - a single snippet of the full text instruction
      返回:
      this builder for chaining options together
    • type

      public abstract BannerComponents.Builder type(@NonNull 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
      参数:
      type - String type from above list
      返回:
      this builder for chaining options together
    • subType

      @NonNull public abstract BannerComponents.Builder subType(@Nullable 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.
      参数:
      subType - String subType from above list
      返回:
      String type from above list
    • abbreviation

      public abstract BannerComponents.Builder abbreviation(@Nullable String abbreviation)
      The abbreviated form of text.
      参数:
      abbreviation - for the given text of this component
      返回:
      this builder for chaining options together
    • abbreviationPriority

      public abstract BannerComponents.Builder abbreviationPriority(@Nullable 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.

      参数:
      abbreviationPriority - Integer indicating the order of the abbreviation
      返回:
      this builder for chaining options together
    • imageBaseUrl

      public abstract BannerComponents.Builder imageBaseUrl(@Nullable 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.
      参数:
      imageBaseUrl - the url which can be used to download the shield icon if one is avaliable
      返回:
      this builder for chaining options together
    • imageUrl

      public abstract BannerComponents.Builder imageUrl(@Nullable 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.
      参数:
      imageUrl - the url which can be used to download the image
      返回:
      this builder for chaining options together
    • directions

      public abstract BannerComponents.Builder directions(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.
      参数:
      directions - List of allowed directions from that lane
      返回:
      this builder for chaining options together
    • active

      public abstract BannerComponents.Builder active(Boolean activeState)
      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.
      参数:
      activeState - true, if the lane could be used for upcoming maneuver, false - otherwise
      返回:
      this builder for chaining options together
    • reference

      public abstract BannerComponents.Builder reference(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
      参数:
      reference -
      返回:
      this builder for chaining options together
    • countryCode

      public abstract BannerComponents.Builder countryCode(String countryCode)
      A string telling you of the local country code
      参数:
      countryCode -
      返回:
      this builder for chaining options together
    • build

      public abstract BannerComponents build()
      Build a new BannerComponents object.
      返回:
      a new BannerComponents using the provided values in this builder