All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.location.model.DeviceState Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon Location module holds the client classes that are used for communicating with Amazon Location Service

There is a newer version: 1.12.780
Show newest version
/*
 * Copyright 2019-2024 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;

/**
 * 

* The device's position, IP address, and Wi-Fi access points. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class DeviceState implements Serializable, Cloneable, StructuredPojo { /** *

* The device identifier. *

*/ private String deviceId; /** *

* The timestamp at which the device's position was determined. Uses ISO 8601 format: * YYYY-MM-DDThh:mm:ss.sssZ. *

*/ private java.util.Date sampleTime; /** *

* The last known device position. *

*/ private java.util.List position; private PositionalAccuracy accuracy; /** *

* The device's Ipv4 address. *

*/ private String ipv4Address; /** *

* The Wi-Fi access points the device is using. *

*/ private java.util.List wiFiAccessPoints; /** *

* The cellular network infrastructure that the device is connected to. *

*/ private CellSignals cellSignals; /** *

* The device identifier. *

* * @param deviceId * The device identifier. */ public void setDeviceId(String deviceId) { this.deviceId = deviceId; } /** *

* The device identifier. *

* * @return The device identifier. */ public String getDeviceId() { return this.deviceId; } /** *

* The device identifier. *

* * @param deviceId * The device identifier. * @return Returns a reference to this object so that method calls can be chained together. */ public DeviceState withDeviceId(String deviceId) { setDeviceId(deviceId); return this; } /** *

* The timestamp at which the device's position was determined. Uses ISO 8601 format: * YYYY-MM-DDThh:mm:ss.sssZ. *

* * @param sampleTime * The timestamp at which the device's position was determined. Uses ISO 8601 format: * 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. *

* * @return The timestamp at which the device's position was determined. Uses ISO 8601 format: * 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. *

* * @param sampleTime * The timestamp at which the device's position was determined. Uses ISO 8601 format: * YYYY-MM-DDThh:mm:ss.sssZ. * @return Returns a reference to this object so that method calls can be chained together. */ public DeviceState withSampleTime(java.util.Date sampleTime) { setSampleTime(sampleTime); return this; } /** *

* The last known device position. *

* * @return The last known device position. */ public java.util.List getPosition() { return position; } /** *

* The last known device position. *

* * @param position * The last known device position. */ public void setPosition(java.util.Collection position) { if (position == null) { this.position = null; return; } this.position = new java.util.ArrayList(position); } /** *

* 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 DeviceState withPosition(Double... position) { if (this.position == null) { setPosition(new java.util.ArrayList(position.length)); } for (Double ele : position) { this.position.add(ele); } return this; } /** *

* 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 DeviceState withPosition(java.util.Collection position) { setPosition(position); return this; } /** * @param accuracy */ public void setAccuracy(PositionalAccuracy accuracy) { this.accuracy = accuracy; } /** * @return */ public PositionalAccuracy getAccuracy() { return this.accuracy; } /** * @param accuracy * @return Returns a reference to this object so that method calls can be chained together. */ public DeviceState withAccuracy(PositionalAccuracy accuracy) { setAccuracy(accuracy); return this; } /** *

* The device's Ipv4 address. *

* * @param ipv4Address * The device's Ipv4 address. */ public void setIpv4Address(String ipv4Address) { this.ipv4Address = ipv4Address; } /** *

* The device's Ipv4 address. *

* * @return The device's Ipv4 address. */ public String getIpv4Address() { return this.ipv4Address; } /** *

* The device's Ipv4 address. *

* * @param ipv4Address * The device's Ipv4 address. * @return Returns a reference to this object so that method calls can be chained together. */ public DeviceState withIpv4Address(String ipv4Address) { setIpv4Address(ipv4Address); return this; } /** *

* The Wi-Fi access points the device is using. *

* * @return The Wi-Fi access points the device is using. */ public java.util.List getWiFiAccessPoints() { return wiFiAccessPoints; } /** *

* The Wi-Fi access points the device is using. *

* * @param wiFiAccessPoints * The Wi-Fi access points the device is using. */ public void setWiFiAccessPoints(java.util.Collection wiFiAccessPoints) { if (wiFiAccessPoints == null) { this.wiFiAccessPoints = null; return; } this.wiFiAccessPoints = new java.util.ArrayList(wiFiAccessPoints); } /** *

* The Wi-Fi access points the device is using. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setWiFiAccessPoints(java.util.Collection)} or {@link #withWiFiAccessPoints(java.util.Collection)} if you * want to override the existing values. *

* * @param wiFiAccessPoints * The Wi-Fi access points the device is using. * @return Returns a reference to this object so that method calls can be chained together. */ public DeviceState withWiFiAccessPoints(WiFiAccessPoint... wiFiAccessPoints) { if (this.wiFiAccessPoints == null) { setWiFiAccessPoints(new java.util.ArrayList(wiFiAccessPoints.length)); } for (WiFiAccessPoint ele : wiFiAccessPoints) { this.wiFiAccessPoints.add(ele); } return this; } /** *

* The Wi-Fi access points the device is using. *

* * @param wiFiAccessPoints * The Wi-Fi access points the device is using. * @return Returns a reference to this object so that method calls can be chained together. */ public DeviceState withWiFiAccessPoints(java.util.Collection wiFiAccessPoints) { setWiFiAccessPoints(wiFiAccessPoints); return this; } /** *

* The cellular network infrastructure that the device is connected to. *

* * @param cellSignals * The cellular network infrastructure that the device is connected to. */ public void setCellSignals(CellSignals cellSignals) { this.cellSignals = cellSignals; } /** *

* The cellular network infrastructure that the device is connected to. *

* * @return The cellular network infrastructure that the device is connected to. */ public CellSignals getCellSignals() { return this.cellSignals; } /** *

* The cellular network infrastructure that the device is connected to. *

* * @param cellSignals * The cellular network infrastructure that the device is connected to. * @return Returns a reference to this object so that method calls can be chained together. */ public DeviceState withCellSignals(CellSignals cellSignals) { setCellSignals(cellSignals); 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 (getDeviceId() != null) sb.append("DeviceId: ").append(getDeviceId()).append(","); if (getSampleTime() != null) sb.append("SampleTime: ").append(getSampleTime()).append(","); if (getPosition() != null) sb.append("Position: ").append("***Sensitive Data Redacted***").append(","); if (getAccuracy() != null) sb.append("Accuracy: ").append(getAccuracy()).append(","); if (getIpv4Address() != null) sb.append("Ipv4Address: ").append(getIpv4Address()).append(","); if (getWiFiAccessPoints() != null) sb.append("WiFiAccessPoints: ").append(getWiFiAccessPoints()).append(","); if (getCellSignals() != null) sb.append("CellSignals: ").append(getCellSignals()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DeviceState == false) return false; DeviceState other = (DeviceState) obj; if (other.getDeviceId() == null ^ this.getDeviceId() == null) return false; if (other.getDeviceId() != null && other.getDeviceId().equals(this.getDeviceId()) == false) return false; if (other.getSampleTime() == null ^ this.getSampleTime() == null) return false; if (other.getSampleTime() != null && other.getSampleTime().equals(this.getSampleTime()) == 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.getAccuracy() == null ^ this.getAccuracy() == null) return false; if (other.getAccuracy() != null && other.getAccuracy().equals(this.getAccuracy()) == false) return false; if (other.getIpv4Address() == null ^ this.getIpv4Address() == null) return false; if (other.getIpv4Address() != null && other.getIpv4Address().equals(this.getIpv4Address()) == false) return false; if (other.getWiFiAccessPoints() == null ^ this.getWiFiAccessPoints() == null) return false; if (other.getWiFiAccessPoints() != null && other.getWiFiAccessPoints().equals(this.getWiFiAccessPoints()) == false) return false; if (other.getCellSignals() == null ^ this.getCellSignals() == null) return false; if (other.getCellSignals() != null && other.getCellSignals().equals(this.getCellSignals()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDeviceId() == null) ? 0 : getDeviceId().hashCode()); hashCode = prime * hashCode + ((getSampleTime() == null) ? 0 : getSampleTime().hashCode()); hashCode = prime * hashCode + ((getPosition() == null) ? 0 : getPosition().hashCode()); hashCode = prime * hashCode + ((getAccuracy() == null) ? 0 : getAccuracy().hashCode()); hashCode = prime * hashCode + ((getIpv4Address() == null) ? 0 : getIpv4Address().hashCode()); hashCode = prime * hashCode + ((getWiFiAccessPoints() == null) ? 0 : getWiFiAccessPoints().hashCode()); hashCode = prime * hashCode + ((getCellSignals() == null) ? 0 : getCellSignals().hashCode()); return hashCode; } @Override public DeviceState clone() { try { return (DeviceState) 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.DeviceStateMarshaller.getInstance().marshall(this, protocolMarshaller); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy