/* * 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 details about the truck dimensions in the unit of measurement that * you specify. Used to filter out roads that can't support or allow the * specified dimensions for requests that specify TravelMode as * Truck. *

*/ public class TruckDimensions implements Serializable { /** *

* The height of the truck. *

* * *

* For routes calculated with a HERE resource, this value must be between 0 * and 50 meters. *

*
*

* Constraints:
* Range: 0.0 -
*/ private Double height; /** *

* The length of the truck. *

* * *

* For routes calculated with a HERE resource, this value must be between 0 * and 300 meters. *

*
*

* Constraints:
* Range: 0.0 -
*/ private Double length; /** *

* Specifies the unit of measurement for the truck dimensions. *

*

* Default Value: Meters *

*

* Constraints:
* Allowed Values: Meters, Feet */ private String unit; /** *

* The width of the truck. *

* * *

* For routes calculated with a HERE resource, this value must be between 0 * and 50 meters. *

*
*

* Constraints:
* Range: 0.0 -
*/ private Double width; /** *

* The height of the truck. *

* * *

* For routes calculated with a HERE resource, this value must be between 0 * and 50 meters. *

*
*

* Constraints:
* Range: 0.0 -
* * @return

* The height of the truck. *

* * *

* For routes calculated with a HERE resource, this value must be * between 0 and 50 meters. *

*
*/ public Double getHeight() { return height; } /** *

* The height of the truck. *

* * *

* For routes calculated with a HERE resource, this value must be between 0 * and 50 meters. *

*
*

* Constraints:
* Range: 0.0 -
* * @param height

* The height of the truck. *

* * *

* For routes calculated with a HERE resource, this value must be * between 0 and 50 meters. *

*
*/ public void setHeight(Double height) { this.height = height; } /** *

* The height of the truck. *

* * *

* For routes calculated with a HERE resource, this value must be between 0 * and 50 meters. *

*
*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Range: 0.0 -
* * @param height

* The height of the truck. *

* * *

* For routes calculated with a HERE resource, this value must be * between 0 and 50 meters. *

*
* @return A reference to this updated object so that method calls can be * chained together. */ public TruckDimensions withHeight(Double height) { this.height = height; return this; } /** *

* The length of the truck. *

* * *

* For routes calculated with a HERE resource, this value must be between 0 * and 300 meters. *

*
*

* Constraints:
* Range: 0.0 -
* * @return

* The length of the truck. *

* * *

* For routes calculated with a HERE resource, this value must be * between 0 and 300 meters. *

*
*/ public Double getLength() { return length; } /** *

* The length of the truck. *

* * *

* For routes calculated with a HERE resource, this value must be between 0 * and 300 meters. *

*
*

* Constraints:
* Range: 0.0 -
* * @param length

* The length of the truck. *

* * *

* For routes calculated with a HERE resource, this value must be * between 0 and 300 meters. *

*
*/ public void setLength(Double length) { this.length = length; } /** *

* The length of the truck. *

* * *

* For routes calculated with a HERE resource, this value must be between 0 * and 300 meters. *

*
*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Range: 0.0 -
* * @param length

* The length of the truck. *

* * *

* For routes calculated with a HERE resource, this value must be * between 0 and 300 meters. *

*
* @return A reference to this updated object so that method calls can be * chained together. */ public TruckDimensions withLength(Double length) { this.length = length; return this; } /** *

* Specifies the unit of measurement for the truck dimensions. *

*

* Default Value: Meters *

*

* Constraints:
* Allowed Values: Meters, Feet * * @return

* Specifies the unit of measurement for the truck dimensions. *

*

* Default Value: Meters *

* @see DimensionUnit */ public String getUnit() { return unit; } /** *

* Specifies the unit of measurement for the truck dimensions. *

*

* Default Value: Meters *

*

* Constraints:
* Allowed Values: Meters, Feet * * @param unit

* Specifies the unit of measurement for the truck dimensions. *

*

* Default Value: Meters *

* @see DimensionUnit */ public void setUnit(String unit) { this.unit = unit; } /** *

* Specifies the unit of measurement for the truck dimensions. *

*

* Default Value: Meters *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: Meters, Feet * * @param unit

* Specifies the unit of measurement for the truck dimensions. *

*

* Default Value: Meters *

* @return A reference to this updated object so that method calls can be * chained together. * @see DimensionUnit */ public TruckDimensions withUnit(String unit) { this.unit = unit; return this; } /** *

* Specifies the unit of measurement for the truck dimensions. *

*

* Default Value: Meters *

*

* Constraints:
* Allowed Values: Meters, Feet * * @param unit

* Specifies the unit of measurement for the truck dimensions. *

*

* Default Value: Meters *

* @see DimensionUnit */ public void setUnit(DimensionUnit unit) { this.unit = unit.toString(); } /** *

* Specifies the unit of measurement for the truck dimensions. *

*

* Default Value: Meters *

*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Allowed Values: Meters, Feet * * @param unit

* Specifies the unit of measurement for the truck dimensions. *

*

* Default Value: Meters *

* @return A reference to this updated object so that method calls can be * chained together. * @see DimensionUnit */ public TruckDimensions withUnit(DimensionUnit unit) { this.unit = unit.toString(); return this; } /** *

* The width of the truck. *

* * *

* For routes calculated with a HERE resource, this value must be between 0 * and 50 meters. *

*
*

* Constraints:
* Range: 0.0 -
* * @return

* The width of the truck. *

* * *

* For routes calculated with a HERE resource, this value must be * between 0 and 50 meters. *

*
*/ public Double getWidth() { return width; } /** *

* The width of the truck. *

* * *

* For routes calculated with a HERE resource, this value must be between 0 * and 50 meters. *

*
*

* Constraints:
* Range: 0.0 -
* * @param width

* The width of the truck. *

* * *

* For routes calculated with a HERE resource, this value must be * between 0 and 50 meters. *

*
*/ public void setWidth(Double width) { this.width = width; } /** *

* The width of the truck. *

* * *

* For routes calculated with a HERE resource, this value must be between 0 * and 50 meters. *

*
*

* Returns a reference to this object so that method calls can be chained * together. *

* Constraints:
* Range: 0.0 -
* * @param width

* The width of the truck. *

* * *

* For routes calculated with a HERE resource, this value must be * between 0 and 50 meters. *

*
* @return A reference to this updated object so that method calls can be * chained together. */ public TruckDimensions withWidth(Double width) { this.width = width; return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getHeight() != null) sb.append("Height: " + getHeight() + ","); if (getLength() != null) sb.append("Length: " + getLength() + ","); if (getUnit() != null) sb.append("Unit: " + getUnit() + ","); if (getWidth() != null) sb.append("Width: " + getWidth()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getHeight() == null) ? 0 : getHeight().hashCode()); hashCode = prime * hashCode + ((getLength() == null) ? 0 : getLength().hashCode()); hashCode = prime * hashCode + ((getUnit() == null) ? 0 : getUnit().hashCode()); hashCode = prime * hashCode + ((getWidth() == null) ? 0 : getWidth().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof TruckDimensions == false) return false; TruckDimensions other = (TruckDimensions) obj; if (other.getHeight() == null ^ this.getHeight() == null) return false; if (other.getHeight() != null && other.getHeight().equals(this.getHeight()) == false) return false; if (other.getLength() == null ^ this.getLength() == null) return false; if (other.getLength() != null && other.getLength().equals(this.getLength()) == false) return false; if (other.getUnit() == null ^ this.getUnit() == null) return false; if (other.getUnit() != null && other.getUnit().equals(this.getUnit()) == false) return false; if (other.getWidth() == null ^ this.getWidth() == null) return false; if (other.getWidth() != null && other.getWidth().equals(this.getWidth()) == false) return false; return true; } }