public java.util.List<Leg> getLegs() {
        return legs;
    }
<p>
Contains details about each path between a pair of positions included along a route such as:
<code>StartPosition</code>, <code>EndPosition</code>, <code>Distance</code>, <code>DurationSeconds</code>,
<code>Geometry</code>, and <code>Steps</code>. The number of legs returned corresponds to one fewer than the
total number of positions in the request.
</p>
<p>
For example, a route with a departure position and destination position returns one leg with the positions <a
href="https://docs.aws.amazon.com/location/latest/developerguide/snap-to-nearby-road.html">snapped to a nearby
road</a>:
</p>
<ul>
<li>
<p>
The <code>StartPosition</code> is the departure position.
</p>
</li>
<li>
<p>
The <code>EndPosition</code> is the destination position.
</p>
</li>
</ul>
<p>
A route with a waypoint between the departure and destination position returns two legs with the positions
snapped to a nearby road:
</p>
<ul>
<li>
<p>
Leg 1: The <code>StartPosition</code> is the departure position . The <code>EndPosition</code> is the waypoint
positon.
</p>
</li>
<li>
<p>
Leg 2: The <code>StartPosition</code> is the waypoint position. The <code>EndPosition</code> is the destination
position.
</p>
</li>
</ul>

@return Contains details about each path between a pair of positions included along a route such as:
        <code>StartPosition</code>, <code>EndPosition</code>, <code>Distance</code>, <code>DurationSeconds</code>
        , <code>Geometry</code>, and <code>Steps</code>. The number of legs returned corresponds to one fewer
        than the total number of positions in the request. </p>
        <p>
        For example, a route with a departure position and destination position returns one leg with the
        positions <a
        href="https://docs.aws.amazon.com/location/latest/developerguide/snap-to-nearby-road.html">snapped to a
        nearby road</a>:
        </p>
        <ul>
        <li>
        <p>
        The <code>StartPosition</code> is the departure position.
        </p>
        </li>
        <li>
        <p>
        The <code>EndPosition</code> is the destination position.
        </p>
        </li>
        </ul>
        <p>
        A route with a waypoint between the departure and destination position returns two legs with the
        positions snapped to a nearby road:
        </p>
        <ul>
        <li>
        <p>
        Leg 1: The <code>StartPosition</code> is the departure position . The <code>EndPosition</code> is the
        waypoint positon.
        </p>
        </li>
        <li>
        <p>
        Leg 2: The <code>StartPosition</code> is the waypoint position. The <code>EndPosition</code> is the
        destination position.
        </p>
        </li>
aws-java-sdk-location/src/main/java/com/amazonaws/services/location/model/CalculateRouteResult.java