/* * Copyright 2018-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.location.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* 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
.
*
* 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.
*
* 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
.
*
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
.
*
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
.
*
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.
*
StartPosition
and EndPosition
. The
* travel mode and departure time that you specify in the request determines the calculated time.
*/
public void setDurationSeconds(Double durationSeconds) {
this.durationSeconds = 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.
*
StartPosition
and EndPosition
. The
* travel mode and departure time that you specify in the request determines the calculated time.
*/
public Double getDurationSeconds() {
return this.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.
*
StartPosition
and EndPosition
. The
* travel mode and departure time that you specify in the request determines the calculated time.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Leg withDurationSeconds(Double durationSeconds) {
setDurationSeconds(durationSeconds);
return this;
}
/**
*
* 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.
*
[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.
*
[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.
*
* NOTE: This method appends the values to the existing list (if any). Use * {@link #setEndPosition(java.util.Collection)} or {@link #withEndPosition(java.util.Collection)} if you want to * override the existing values. *
* * @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.
*
[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. *
* * @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. *
* * @return Contains the calculated route's path as a linestring geometry. */ public LegGeometry getGeometry() { return this.geometry; } /** ** Contains the calculated route's path as a linestring geometry. *
* * @param geometry * Contains the calculated route's path as a linestring geometry. * @return Returns a reference to this object so that method calls can be chained together. */ public Leg withGeometry(LegGeometry geometry) { setGeometry(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.
*
[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.
*
[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.
*
* NOTE: This method appends the values to the existing list (if any). Use * {@link #setStartPosition(java.util.Collection)} or {@link #withStartPosition(java.util.Collection)} if you want * to override the existing values. *
* * @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.
*
[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. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setSteps(java.util.Collection)} or {@link #withSteps(java.util.Collection)} if you want to override the * existing values. *
* * @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 Returns a reference to this object so that method calls can be chained together. */ public Leg withSteps(Step... steps) { if (this.steps == null) { setSteps(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. *
* * @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 Returns a reference to this object so that method calls can be chained together. */ public Leg withSteps(java.util.Collection