/* * 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 position update details for a device. *
* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class DevicePositionUpdate implements Serializable, Cloneable, StructuredPojo { /** ** The accuracy of the device position. *
*/ private PositionalAccuracy accuracy; /** ** The device associated to the position update. *
*/ private String deviceId; /** *
* The latest device position defined in WGS 84 format:
* [X or longitude, Y or latitude]
.
*
* Associates one of more properties with the position update. A property is a key-value pair stored with the * position update and added to any geofence event the update may trigger. *
*
* Format: "key" : "value"
*
* 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 DevicePositionUpdate withAccuracy(PositionalAccuracy accuracy) { setAccuracy(accuracy); return this; } /** ** The device associated to the position update. *
* * @param deviceId * The device associated to the position update. */ public void setDeviceId(String deviceId) { this.deviceId = deviceId; } /** ** The device associated to the position update. *
* * @return The device associated to the position update. */ public String getDeviceId() { return this.deviceId; } /** ** The device associated to the position update. *
* * @param deviceId * The device associated to the position update. * @return Returns a reference to this object so that method calls can be chained together. */ public DevicePositionUpdate withDeviceId(String deviceId) { setDeviceId(deviceId); return this; } /** *
* The latest device position defined in WGS 84 format:
* [X or longitude, Y or latitude]
.
*
[X or longitude, Y or latitude]
.
*/
public java.util.List
* The latest device position defined in WGS 84 format:
* [X or longitude, Y or latitude]
.
*
[X or longitude, Y or latitude]
.
*/
public void setPosition(java.util.Collection
* The latest device position defined in WGS 84 format:
* [X or longitude, Y or latitude]
.
*
* 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 latest device position defined in WGS 84 format: *[X or longitude, Y or latitude]
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DevicePositionUpdate withPosition(Double... position) {
if (this.position == null) {
setPosition(new java.util.ArrayList
* The latest device position defined in WGS 84 format:
* [X or longitude, Y or latitude]
.
*
[X or longitude, Y or latitude]
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DevicePositionUpdate withPosition(java.util.Collection* Associates one of more properties with the position update. A property is a key-value pair stored with the * position update and added to any geofence event the update may trigger. *
*
* Format: "key" : "value"
*
* Format:
* Associates one of more properties with the position update. A property is a key-value pair stored with the
* position update and added to any geofence event the update may trigger.
*
* Format: "key" : "value"
*/
public java.util.Map"key" : "value"
*
* Format:
* Associates one of more properties with the position update. A property is a key-value pair stored with the
* position update and added to any geofence event the update may trigger.
*
* Format: "key" : "value"
*/
public void setPositionProperties(java.util.Map"key" : "value"
*
* Format:
* The timestamp at which the device's position was determined. Uses ISO 8601 format:
*
* The timestamp at which the device's position was determined. Uses ISO 8601 format:
*
* The timestamp at which the device's position was determined. Uses ISO 8601 format:
* "key" : "value"
* @return Returns a reference to this object so that method calls can be chained together.
*/
public DevicePositionUpdate withPositionProperties(java.util.MapYYYY-MM-DDThh:mm:ss.sssZ
* YYYY-MM-DDThh:mm:ss.sssZ
*/
public void setSampleTime(java.util.Date sampleTime) {
this.sampleTime = sampleTime;
}
/**
* YYYY-MM-DDThh:mm:ss.sssZ
* YYYY-MM-DDThh:mm:ss.sssZ
*/
public java.util.Date getSampleTime() {
return this.sampleTime;
}
/**
* 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 DevicePositionUpdate 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 (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 DevicePositionUpdate == false)
return false;
DevicePositionUpdate other = (DevicePositionUpdate) 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.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 + ((getSampleTime() == null) ? 0 : getSampleTime().hashCode());
return hashCode;
}
@Override
public DevicePositionUpdate clone() {
try {
return (DevicePositionUpdate) 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.DevicePositionUpdateMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}