类 DirectionsRoute

java.lang.Object
ai.nextbillion.kits.directions.models.DirectionsJsonObject
ai.nextbillion.kits.directions.models.DirectionsRoute
所有已实现的接口:
Serializable

public abstract class DirectionsRoute extends DirectionsJsonObject
Detailed information about an individual route such as the duration, distance and geometry.
另请参阅:
  • 构造器详细资料

    • DirectionsRoute

      public DirectionsRoute()
  • 方法详细资料

    • builder

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

      @Nullable public abstract String routeIndex()
      The index of this route in the original network response.
      返回:
      string of an int value representing the index
    • distance

      @NonNull public abstract Double distance()
      The distance traveled from origin to destination.
      返回:
      a double number with unit meters
    • duration

      @NonNull public abstract Double duration()
      The estimated travel time from origin to destination.
      返回:
      a double number with unit seconds
    • durationTypical

      @Nullable @SerializedName("duration_typical") public abstract 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).
      返回:
      a double number with unit seconds
    • geometry

      @Nullable public abstract String geometry()
      Gives the geometry of the route. Commonly used to draw the route on the map view.
      返回:
      an encoded polyline string
    • weight

      @Nullable public abstract Double weight()
      The calculated weight of the route.
      返回:
      the weight value provided from the API as a double value
    • weightName

      @Nullable @SerializedName("weight_name") public abstract 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.
      返回:
      a String representing the weight profile used while calculating the route
    • legs

      @Nullable public abstract List<RouteLeg> legs()
      A Leg is a route between only two waypoints.
      返回:
      list of RouteLeg objects
    • routeOptions

      @Nullable public abstract RouteOptions routeOptions()
      Holds onto the parameter information used when making the directions request. Useful for re-requesting a directions route using the same information previously used.
      返回:
      a RouteOptionss object which holds onto critical information from the request that cannot be derived directly from the directions route
    • voiceLanguage

      @Nullable @SerializedName("voiceLocale") public abstract String voiceLanguage()
      String of the language to be used for voice instructions. Defaults to en, and can be any accepted instruction language. Will be null when the language provided NbmapDirections.Builder#language() via is not compatible with API Voice.
      返回:
      String compatible with voice instructions, null otherwise
    • toBuilder

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

      public static com.google.gson.TypeAdapter<DirectionsRoute> 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 DirectionsRoute 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 GeoJson Directions Route
      返回:
      a new instance of this class defined by the values passed inside this static factory method