类 RouteLeg

所有已实现的接口:
Serializable

public abstract class RouteLeg extends DirectionsJsonObject
A route between only two DirectionsWaypoint.
另请参阅:
  • 构造器详细资料

    • RouteLeg

      public RouteLeg()
  • 方法详细资料

    • builder

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

      @Nullable public abstract Double distance()
      The distance traveled from one waypoint to another.
      返回:
      a double number with unit meters
    • duration

      @Nullable public abstract Double duration()
      The estimated travel time from one waypoint to another.
      返回:
      a double number with unit seconds
    • durationTypical

      @Nullable @SerializedName("duration_typical") public abstract Double durationTypical()
      The typical travel time for traversing this RouteLeg. There's a delay along the RouteLeg if you subtract this durationTypical() value from the RouteLeg 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
    • summary

      @Nullable public abstract String summary()
      A short human-readable summary of major roads traversed. Useful to distinguish alternatives.
      返回:
      String with summary
    • admins

      @Nullable public abstract List<Admin> admins()
      An array of objects describing the administrative boundaries the route leg travels through. Use StepIntersection.adminIndex() on the intersection object to look up the admin for each intersection in this array.
    • steps

      @Nullable public abstract List<LegStep> steps()
      Gives a List including all the steps to get from one waypoint to another.
      返回:
      List of LegStep
    • incidents

      @Nullable public abstract List<Incident> incidents()
      A list of incidents that occur on this leg.
      返回:
      a list of Incident
    • annotation

      @Nullable public abstract LegAnnotation annotation()
      A LegAnnotation that contains additional details about each line segment along the route geometry. If you'd like to receiving this, you must request it inside your Directions request before executing the call.
      返回:
      a LegAnnotation object
    • closures

      @Nullable public abstract List<Closure> closures()
      A list of closures that occur on this leg.
      返回:
      a list of Incident
    • toBuilder

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

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