com.amazonaws.services.devicefarm.model.Location Maven / Gradle / Ivy
                 Go to download
                
        
                    Show more of this group  Show more artifacts with this name
Show all versions of aws-java-sdk-devicefarm Show documentation
                Show all versions of aws-java-sdk-devicefarm Show documentation
The AWS Java SDK for AWS Device Farm module holds the client classes that are used for communicating with AWS Device Farm
                
            /*
 * Copyright 2011-2016 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.devicefarm.model;
import java.io.Serializable;
/**
 * 
 * Represents a latitude and longitude pair, expressed in geographic coordinate system degrees (for example 47.6204,
 * -122.3491).
 * 
 * 
 * Elevation is currently not supported.
 * 
 */
public class Location implements Serializable, Cloneable {
    /**
     * 
     * The latitude.
     * 
     */
    private Double latitude;
    /**
     * 
     * The longitude.
     * 
     */
    private Double longitude;
    /**
     * 
     * The latitude.
     * 
     * 
     * @param latitude
     *        The latitude.
     */
    public void setLatitude(Double latitude) {
        this.latitude = latitude;
    }
    /**
     * 
     * The latitude.
     * 
     * 
     * @return The latitude.
     */
    public Double getLatitude() {
        return this.latitude;
    }
    /**
     * 
     * The latitude.
     * 
     * 
     * @param latitude
     *        The latitude.
     * @return Returns a reference to this object so that method calls can be chained together.
     */
    public Location withLatitude(Double latitude) {
        setLatitude(latitude);
        return this;
    }
    /**
     * 
     * The longitude.
     * 
     * 
     * @param longitude
     *        The longitude.
     */
    public void setLongitude(Double longitude) {
        this.longitude = longitude;
    }
    /**
     * 
     * The longitude.
     * 
     * 
     * @return The longitude.
     */
    public Double getLongitude() {
        return this.longitude;
    }
    /**
     * 
     * The longitude.
     * 
     * 
     * @param longitude
     *        The longitude.
     * @return Returns a reference to this object so that method calls can be chained together.
     */
    public Location withLongitude(Double longitude) {
        setLongitude(longitude);
        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 (getLatitude() != null)
            sb.append("Latitude: " + getLatitude() + ",");
        if (getLongitude() != null)
            sb.append("Longitude: " + getLongitude());
        sb.append("}");
        return sb.toString();
    }
    @Override
    public boolean equals(Object obj) {
        if (this == obj)
            return true;
        if (obj == null)
            return false;
        if (obj instanceof Location == false)
            return false;
        Location other = (Location) obj;
        if (other.getLatitude() == null ^ this.getLatitude() == null)
            return false;
        if (other.getLatitude() != null && other.getLatitude().equals(this.getLatitude()) == false)
            return false;
        if (other.getLongitude() == null ^ this.getLongitude() == null)
            return false;
        if (other.getLongitude() != null && other.getLongitude().equals(this.getLongitude()) == false)
            return false;
        return true;
    }
    @Override
    public int hashCode() {
        final int prime = 31;
        int hashCode = 1;
        hashCode = prime * hashCode + ((getLatitude() == null) ? 0 : getLatitude().hashCode());
        hashCode = prime * hashCode + ((getLongitude() == null) ? 0 : getLongitude().hashCode());
        return hashCode;
    }
    @Override
    public Location clone() {
        try {
            return (Location) super.clone();
        } catch (CloneNotSupportedException e) {
            throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
        }
    }
}
    © 2015 - 2025 Weber Informatics LLC | Privacy Policy