/* * 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 device position details. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class DevicePosition implements Serializable, Cloneable, StructuredPojo { /** ** The accuracy of the device position. *
*/ private PositionalAccuracy accuracy; /** ** The device whose position you retrieved. *
*/ private String deviceId; /** ** The last known device position. *
*/ private java.util.List* The properties associated with the position. *
*/ private java.util.Map
* The timestamp for when the tracker resource received the device position in ISO 8601 format:
* YYYY-MM-DDThh:mm:ss.sssZ
.
*
* The timestamp at which the device's position was determined. Uses ISO 8601 format:
* YYYY-MM-DDThh:mm:ss.sssZ
.
*
* The accuracy of the device position. *
* * @param accuracy * The accuracy of the device position. */ public void setAccuracy(PositionalAccuracy accuracy) { this.accuracy = accuracy; } /** ** The accuracy of the device position. *
* * @return The accuracy of the device position. */ public PositionalAccuracy getAccuracy() { return this.accuracy; } /** ** The accuracy of the device position. *
* * @param accuracy * The accuracy of the device position. * @return Returns a reference to this object so that method calls can be chained together. */ public DevicePosition withAccuracy(PositionalAccuracy accuracy) { setAccuracy(accuracy); return this; } /** ** The device whose position you retrieved. *
* * @param deviceId * The device whose position you retrieved. */ public void setDeviceId(String deviceId) { this.deviceId = deviceId; } /** ** The device whose position you retrieved. *
* * @return The device whose position you retrieved. */ public String getDeviceId() { return this.deviceId; } /** ** The device whose position you retrieved. *
* * @param deviceId * The device whose position you retrieved. * @return Returns a reference to this object so that method calls can be chained together. */ public DevicePosition withDeviceId(String deviceId) { setDeviceId(deviceId); return this; } /** ** The last known device position. *
* * @return The last known device position. */ public java.util.List* The last known device position. *
* * @param position * The last known device position. */ public void setPosition(java.util.Collection* The last known device position. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setPosition(java.util.Collection)} or {@link #withPosition(java.util.Collection)} if you want to override * the existing values. *
* * @param position * The last known device position. * @return Returns a reference to this object so that method calls can be chained together. */ public DevicePosition withPosition(Double... position) { if (this.position == null) { setPosition(new java.util.ArrayList* The last known device position. *
* * @param position * The last known device position. * @return Returns a reference to this object so that method calls can be chained together. */ public DevicePosition withPosition(java.util.Collection* The properties associated with the position. *
* * @return The properties associated with the position. */ public java.util.Map* The properties associated with the position. *
* * @param positionProperties * The properties associated with the position. */ public void setPositionProperties(java.util.Map* The properties associated with the position. *
* * @param positionProperties * The properties associated with the position. * @return Returns a reference to this object so that method calls can be chained together. */ public DevicePosition withPositionProperties(java.util.Map
* The timestamp for when the tracker resource received the device position in ISO 8601 format:
* YYYY-MM-DDThh:mm:ss.sssZ
.
*
YYYY-MM-DDThh:mm:ss.sssZ
.
*/
public void setReceivedTime(java.util.Date receivedTime) {
this.receivedTime = receivedTime;
}
/**
*
* The timestamp for when the tracker resource received the device position in ISO 8601 format:
* YYYY-MM-DDThh:mm:ss.sssZ
.
*
YYYY-MM-DDThh:mm:ss.sssZ
.
*/
public java.util.Date getReceivedTime() {
return this.receivedTime;
}
/**
*
* The timestamp for when the tracker resource received the device position in ISO 8601 format:
* YYYY-MM-DDThh:mm:ss.sssZ
.
*
YYYY-MM-DDThh:mm:ss.sssZ
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DevicePosition withReceivedTime(java.util.Date receivedTime) {
setReceivedTime(receivedTime);
return this;
}
/**
*
* The timestamp at which the device's position was determined. Uses ISO 8601 format:
* YYYY-MM-DDThh:mm:ss.sssZ
.
*
YYYY-MM-DDThh:mm:ss.sssZ
.
*/
public void setSampleTime(java.util.Date sampleTime) {
this.sampleTime = sampleTime;
}
/**
*
* The timestamp at which the device's position was determined. Uses ISO 8601 format:
* YYYY-MM-DDThh:mm:ss.sssZ
.
*
YYYY-MM-DDThh:mm:ss.sssZ
.
*/
public java.util.Date getSampleTime() {
return this.sampleTime;
}
/**
*
* The timestamp at which the device's position was determined. Uses ISO 8601 format:
* YYYY-MM-DDThh:mm:ss.sssZ
.
*
YYYY-MM-DDThh:mm:ss.sssZ
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DevicePosition withSampleTime(java.util.Date sampleTime) {
setSampleTime(sampleTime);
return this;
}
/**
* Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be
* redacted from this string using a placeholder value.
*
* @return A string representation of this object.
*
* @see java.lang.Object#toString()
*/
@Override
public String toString() {
StringBuilder sb = new StringBuilder();
sb.append("{");
if (getAccuracy() != null)
sb.append("Accuracy: ").append(getAccuracy()).append(",");
if (getDeviceId() != null)
sb.append("DeviceId: ").append(getDeviceId()).append(",");
if (getPosition() != null)
sb.append("Position: ").append("***Sensitive Data Redacted***").append(",");
if (getPositionProperties() != null)
sb.append("PositionProperties: ").append("***Sensitive Data Redacted***").append(",");
if (getReceivedTime() != null)
sb.append("ReceivedTime: ").append(getReceivedTime()).append(",");
if (getSampleTime() != null)
sb.append("SampleTime: ").append(getSampleTime());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof DevicePosition == false)
return false;
DevicePosition other = (DevicePosition) obj;
if (other.getAccuracy() == null ^ this.getAccuracy() == null)
return false;
if (other.getAccuracy() != null && other.getAccuracy().equals(this.getAccuracy()) == false)
return false;
if (other.getDeviceId() == null ^ this.getDeviceId() == null)
return false;
if (other.getDeviceId() != null && other.getDeviceId().equals(this.getDeviceId()) == false)
return false;
if (other.getPosition() == null ^ this.getPosition() == null)
return false;
if (other.getPosition() != null && other.getPosition().equals(this.getPosition()) == false)
return false;
if (other.getPositionProperties() == null ^ this.getPositionProperties() == null)
return false;
if (other.getPositionProperties() != null && other.getPositionProperties().equals(this.getPositionProperties()) == false)
return false;
if (other.getReceivedTime() == null ^ this.getReceivedTime() == null)
return false;
if (other.getReceivedTime() != null && other.getReceivedTime().equals(this.getReceivedTime()) == false)
return false;
if (other.getSampleTime() == null ^ this.getSampleTime() == null)
return false;
if (other.getSampleTime() != null && other.getSampleTime().equals(this.getSampleTime()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getAccuracy() == null) ? 0 : getAccuracy().hashCode());
hashCode = prime * hashCode + ((getDeviceId() == null) ? 0 : getDeviceId().hashCode());
hashCode = prime * hashCode + ((getPosition() == null) ? 0 : getPosition().hashCode());
hashCode = prime * hashCode + ((getPositionProperties() == null) ? 0 : getPositionProperties().hashCode());
hashCode = prime * hashCode + ((getReceivedTime() == null) ? 0 : getReceivedTime().hashCode());
hashCode = prime * hashCode + ((getSampleTime() == null) ? 0 : getSampleTime().hashCode());
return hashCode;
}
@Override
public DevicePosition clone() {
try {
return (DevicePosition) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
@com.amazonaws.annotation.SdkInternalApi
@Override
public void marshall(ProtocolMarshaller protocolMarshaller) {
com.amazonaws.services.location.model.transform.DevicePositionMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}