类 DirectionsRoute.Builder

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

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

    • Builder

      public Builder()
  • 方法详细资料

    • distance

      public abstract DirectionsRoute.Builder distance(@NonNull Double distance)
      The distance traveled from origin to destination.
      参数:
      distance - a double number with unit meters
      返回:
      this builder for chaining options together
    • duration

      public abstract DirectionsRoute.Builder duration(@NonNull Double duration)
      The estimated travel time from origin to destination.
      参数:
      duration - a double number with unit seconds
      返回:
      this builder for chaining options together
    • durationTypical

      public abstract DirectionsRoute.Builder durationTypical(@Nullable Double durationTypical)
      The typical travel time from this route's origin to destination. There's a delay along this route if you subtract this durationTypical() value from the route's duration() value and the resulting difference is greater than 0. The delay is because of any number of real-world situations (road repair, traffic jam, etc).
      参数:
      durationTypical - a double number with unit seconds
      返回:
      this builder for chaining options together
    • geometry

      public abstract DirectionsRoute.Builder geometry(@Nullable String geometry)
      Gives the geometry of the route. Commonly used to draw the route on the map view.
      参数:
      geometry - an encoded polyline string
      返回:
      this builder for chaining options together
    • weight

      public abstract DirectionsRoute.Builder weight(@Nullable Double weight)
      The calculated weight of the route.
      参数:
      weight - the weight value provided from the API as a double value
      返回:
      this builder for chaining options together
    • weightName

      public abstract DirectionsRoute.Builder weightName(@Nullable String weightName)
      The name of the weight profile used while calculating during extraction phase. The default is routability which is duration based, with additional penalties for less desirable maneuvers.
      参数:
      weightName - a String representing the weight profile used while calculating the route
      返回:
      this builder for chaining options together
    • legs

      public abstract DirectionsRoute.Builder legs(@Nullable List<RouteLeg> legs)
      A Leg is a route between only two waypoints.
      参数:
      legs - list of RouteLeg objects
      返回:
      this builder for chaining options together
    • routeOptions

      public abstract DirectionsRoute.Builder routeOptions(@Nullable RouteOptions routeOptions)
      Holds onto the parameter information used when making the directions request.
      参数:
      routeOptions - a RouteOptionss object which holds onto critical information from the request that cannot be derived directly from the directions route
      返回:
      this builder for chaining options together
    • voiceLanguage

      public abstract DirectionsRoute.Builder voiceLanguage(@Nullable String voiceLanguage)
      String of the language to be used for voice instructions. Defaults to en, and can be any accepted instruction language.
      参数:
      voiceLanguage - String compatible with voice instructions, null otherwise
      返回:
      this builder for chaining options together
    • build

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