/* * Copyright 2010-2023 Amazon.com, Inc. or its affiliates. All Rights Reserved. * * Licensed under the Apache License, Version 2.0 (the "License"). * You may not use this file except in compliance with the License. * A copy of the License is located at * * http://aws.amazon.com/apache2.0 * * or in the "license" file accompanying this file. This file is distributed * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either * express or implied. See the License for the specific language governing * permissions and limitations under the License. */ package com.amazonaws.services.geo.model; import java.io.Serializable; /** *
* Contains the calculated route's details for each path between a pair of * positions. The number of legs returned corresponds to one fewer than the * total number of positions in the request. *
** For example, a route with a departure position and destination position * returns one leg with the positions snapped to a nearby road: *
*
* The StartPosition
is the departure position.
*
* The EndPosition
is the destination position.
*
* A route with a waypoint between the departure and destination position * returns two legs with the positions snapped to a nearby road: *
*
* Leg 1: The StartPosition
is the departure position . The
* EndPosition
is the waypoint positon.
*
* Leg 2: The StartPosition
is the waypoint position. The
* EndPosition
is the destination position.
*
* 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
.
*
* Constraints:
* Range: 0.0 -
*/
private Double distance;
/**
*
* 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.
*
* Constraints:
* Range: 0.0 -
*/
private Double durationSeconds;
/**
*
* 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.
*
* Contains the calculated route's path as a linestring geometry. *
*/ private LegGeometry geometry; /** *
* 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.
*
* 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. *
*/ private java.util.List
* 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
.
*
* Constraints:
* Range: 0.0 -
*
* @return
* 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
.
*
* 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
.
*
* Constraints:
* Range: 0.0 -
*
* @param 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
.
*
* 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 a reference to this object so that method calls can be chained * together. *
* Constraints:
* Range: 0.0 -
*
* @param 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
.
*
* 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.
*
* Constraints:
* Range: 0.0 -
*
* @return
* 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.
*
* 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.
*
* Constraints:
* Range: 0.0 -
*
* @param 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.
*
* 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 a reference to this object so that method calls can be chained * together. *
* Constraints:
* Range: 0.0 -
*
* @param 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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 a reference to this object so that method calls can be chained * together. * * @param 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.
*
* 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 a reference to this object so that method calls can be chained * together. * * @param 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.
*
* Contains the calculated route's path as a linestring geometry. *
* * @return* Contains the calculated route's path as a linestring geometry. *
*/ public LegGeometry getGeometry() { return geometry; } /** ** Contains the calculated route's path as a linestring geometry. *
* * @param geometry* Contains the calculated route's path as a linestring geometry. *
*/ public void setGeometry(LegGeometry geometry) { this.geometry = geometry; } /** ** Contains the calculated route's path as a linestring geometry. *
** Returns a reference to this object so that method calls can be chained * together. * * @param geometry
* Contains the calculated route's path as a linestring geometry. *
* @return A reference to this updated object so that method calls can be * chained together. */ public Leg withGeometry(LegGeometry geometry) { this.geometry = geometry; return this; } /** *
* 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.
*
* 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.
*
* 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.
*
* 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.
*
* 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 a reference to this object so that method calls can be chained * together. * * @param 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.
*
* 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 a reference to this object so that method calls can be chained * together. * * @param 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.
*
* 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. *
* * @return* 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. *
*/ public java.util.List* 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. *
* * @param 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. *
*/ public void setSteps(java.util.Collection* 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 a reference to this object so that method calls can be chained * together. * * @param 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. *
* @return A reference to this updated object so that method calls can be * chained together. */ public Leg withSteps(Step... steps) { if (getSteps() == null) { this.steps = new java.util.ArrayList* 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 a reference to this object so that method calls can be chained * together. * * @param 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. *
* @return A reference to this updated object so that method calls can be * chained together. */ public Leg withSteps(java.util.Collection