类 DirectionsResponse.Builder

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

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

    • Builder

      public Builder()
  • 方法详细资料

    • code

      public abstract DirectionsResponse.Builder code(@NonNull String code)
      String indicating the state of the response. This is a separate code than the HTTP status code. On normal valid responses, the value will be Ok. For a full list of possible responses, see DirectionsResponse.code().
      参数:
      code - a string with one of the given values described in the list above
      返回:
      this builder for chaining options together
    • message

      public abstract DirectionsResponse.Builder message(@Nullable String message)
      Optionally shows up in a directions response if an error or something unexpected occurred.
      参数:
      message - a string containing the message API Directions response with if an error occurred
      返回:
      this builder for chaining options together
    • waypoints

      public abstract DirectionsResponse.Builder waypoints(@Nullable List<DirectionsWaypoint> waypoints)
      List of DirectionsWaypoint objects. Each waypoint is an input coordinate snapped to the road and path network. The waypoint appear in the list in the order of the input coordinates.
      参数:
      waypoints - list of DirectionsWaypoint objects ordered from start of route till the end
      返回:
      this builder for chaining options together
    • routes

      public abstract DirectionsResponse.Builder routes(@NonNull List<DirectionsRoute> routes)
      List containing all the different route options. It's ordered by descending recommendation rank. In other words, object 0 in the List is the highest recommended route. if you don't setAlternatives to true (default is false) in your builder this should always be a List of size 1. At most this will return 2 DirectionsRoute objects.
      参数:
      routes - list of DirectionsRoute objects
      返回:
      this builder for chaining options together
    • country_code

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

      public abstract DirectionsResponse.Builder uuid(@Nullable String uuid)
      A universally unique identifier (UUID) for identifying and executing a similar specific route in the future.
      参数:
      uuid - a String representing the UUID given by the directions request
      返回:
      this builder for chaining options together
    • build

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