Interface Leg.Builder

All Superinterfaces:
Buildable, CopyableBuilder<Leg.Builder,Leg>, SdkBuilder<Leg.Builder,Leg>, SdkPojo
Enclosing class:
Leg

public static interface Leg.Builder extends SdkPojo, CopyableBuilder<Leg.Builder,Leg>
  • Method Details

    • distance

      Leg.Builder distance(Double distance)

      The distance between the leg's StartPosition and EndPosition along a calculated route.

      • The default measurement is Kilometers unless the request specifies a DistanceUnit of Miles.

      Parameters:
      distance - The distance between the leg's StartPosition and EndPosition along a calculated route.

      • The default measurement is Kilometers unless the request specifies a DistanceUnit of Miles.

      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • durationSeconds

      Leg.Builder durationSeconds(Double durationSeconds)

      The estimated travel time between the leg's StartPosition and EndPosition. The travel mode and departure time that you specify in the request determines the calculated time.

      Parameters:
      durationSeconds - The estimated travel time between the leg's StartPosition and EndPosition. The travel mode and departure time that you specify in the request determines the calculated time.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • endPosition

      Leg.Builder endPosition(Collection<Double> endPosition)

      The terminating position of the leg. Follows the format [longitude,latitude].

      If the EndPosition isn't located on a road, it's snapped to a nearby road.

      Parameters:
      endPosition - The terminating position of the leg. Follows the format [longitude,latitude].

      If the EndPosition isn't located on a road, it's snapped to a nearby road.

      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • endPosition

      Leg.Builder endPosition(Double... endPosition)

      The terminating position of the leg. Follows the format [longitude,latitude].

      If the EndPosition isn't located on a road, it's snapped to a nearby road.

      Parameters:
      endPosition - The terminating position of the leg. Follows the format [longitude,latitude].

      If the EndPosition isn't located on a road, it's snapped to a nearby road.

      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • geometry

      Leg.Builder geometry(LegGeometry geometry)

      Contains the calculated route's path as a linestring geometry.

      Parameters:
      geometry - Contains the calculated route's path as a linestring geometry.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • geometry

      default Leg.Builder geometry(Consumer<LegGeometry.Builder> geometry)

      Contains the calculated route's path as a linestring geometry.

      This is a convenience method that creates an instance of the LegGeometry.Builder avoiding the need to create one manually via LegGeometry.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to geometry(LegGeometry).

      Parameters:
      geometry - a consumer that will call methods on LegGeometry.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also:
    • startPosition

      Leg.Builder startPosition(Collection<Double> startPosition)

      The starting position of the leg. Follows the format [longitude,latitude].

      If the StartPosition isn't located on a road, it's snapped to a nearby road.

      Parameters:
      startPosition - The starting position of the leg. Follows the format [longitude,latitude].

      If the StartPosition isn't located on a road, it's snapped to a nearby road.

      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • startPosition

      Leg.Builder startPosition(Double... startPosition)

      The starting position of the leg. Follows the format [longitude,latitude].

      If the StartPosition isn't located on a road, it's snapped to a nearby road.

      Parameters:
      startPosition - The starting position of the leg. Follows the format [longitude,latitude].

      If the StartPosition isn't located on a road, it's snapped to a nearby road.

      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • steps

      Leg.Builder steps(Collection<Step> steps)

      Contains a list of steps, which represent subsections of a leg. Each step provides instructions for how to move to the next step in the leg such as the step's start position, end position, travel distance, travel duration, and geometry offset.

      Parameters:
      steps - Contains a list of steps, which represent subsections of a leg. Each step provides instructions for how to move to the next step in the leg such as the step's start position, end position, travel distance, travel duration, and geometry offset.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • steps

      Leg.Builder steps(Step... steps)

      Contains a list of steps, which represent subsections of a leg. Each step provides instructions for how to move to the next step in the leg such as the step's start position, end position, travel distance, travel duration, and geometry offset.

      Parameters:
      steps - Contains a list of steps, which represent subsections of a leg. Each step provides instructions for how to move to the next step in the leg such as the step's start position, end position, travel distance, travel duration, and geometry offset.
      Returns:
      Returns a reference to this object so that method calls can be chained together.
    • steps

      Leg.Builder steps(Consumer<Step.Builder>... steps)

      Contains a list of steps, which represent subsections of a leg. Each step provides instructions for how to move to the next step in the leg such as the step's start position, end position, travel distance, travel duration, and geometry offset.

      This is a convenience method that creates an instance of the Step.Builder avoiding the need to create one manually via Step.builder().

      When the Consumer completes, SdkBuilder.build() is called immediately and its result is passed to steps(List<Step>).

      Parameters:
      steps - a consumer that will call methods on Step.Builder
      Returns:
      Returns a reference to this object so that method calls can be chained together.
      See Also: