/* * 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.iot1clickdevices.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** * * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class DeviceDescription implements Serializable, Cloneable, StructuredPojo { /** *

* The ARN of the device. *

*/ private String arn; /** *

* An array of zero or more elements of DeviceAttribute objects providing user specified device attributes. *

*/ private java.util.Map attributes; /** *

* The unique identifier of the device. *

*/ private String deviceId; /** *

* A Boolean value indicating whether or not the device is enabled. *

*/ private Boolean enabled; /** *

* A value between 0 and 1 inclusive, representing the fraction of life remaining for the device. *

*/ private Double remainingLife; /** *

* The type of the device, such as "button". *

*/ private String type; /** *

* The tags currently associated with the AWS IoT 1-Click device. *

*/ private java.util.Map tags; /** *

* The ARN of the device. *

* * @param arn * The ARN of the device. */ public void setArn(String arn) { this.arn = arn; } /** *

* The ARN of the device. *

* * @return The ARN of the device. */ public String getArn() { return this.arn; } /** *

* The ARN of the device. *

* * @param arn * The ARN of the device. * @return Returns a reference to this object so that method calls can be chained together. */ public DeviceDescription withArn(String arn) { setArn(arn); return this; } /** *

* An array of zero or more elements of DeviceAttribute objects providing user specified device attributes. *

* * @return An array of zero or more elements of DeviceAttribute objects providing user specified device attributes. */ public java.util.Map getAttributes() { return attributes; } /** *

* An array of zero or more elements of DeviceAttribute objects providing user specified device attributes. *

* * @param attributes * An array of zero or more elements of DeviceAttribute objects providing user specified device attributes. */ public void setAttributes(java.util.Map attributes) { this.attributes = attributes; } /** *

* An array of zero or more elements of DeviceAttribute objects providing user specified device attributes. *

* * @param attributes * An array of zero or more elements of DeviceAttribute objects providing user specified device attributes. * @return Returns a reference to this object so that method calls can be chained together. */ public DeviceDescription withAttributes(java.util.Map attributes) { setAttributes(attributes); return this; } /** * Add a single Attributes entry * * @see DeviceDescription#withAttributes * @returns a reference to this object so that method calls can be chained together. */ public DeviceDescription addAttributesEntry(String key, String value) { if (null == this.attributes) { this.attributes = new java.util.HashMap(); } if (this.attributes.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.attributes.put(key, value); return this; } /** * Removes all the entries added into Attributes. * * @return Returns a reference to this object so that method calls can be chained together. */ public DeviceDescription clearAttributesEntries() { this.attributes = null; return this; } /** *

* The unique identifier of the device. *

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

* The unique identifier of the device. *

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

* The unique identifier of the device. *

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

* A Boolean value indicating whether or not the device is enabled. *

* * @param enabled * A Boolean value indicating whether or not the device is enabled. */ public void setEnabled(Boolean enabled) { this.enabled = enabled; } /** *

* A Boolean value indicating whether or not the device is enabled. *

* * @return A Boolean value indicating whether or not the device is enabled. */ public Boolean getEnabled() { return this.enabled; } /** *

* A Boolean value indicating whether or not the device is enabled. *

* * @param enabled * A Boolean value indicating whether or not the device is enabled. * @return Returns a reference to this object so that method calls can be chained together. */ public DeviceDescription withEnabled(Boolean enabled) { setEnabled(enabled); return this; } /** *

* A Boolean value indicating whether or not the device is enabled. *

* * @return A Boolean value indicating whether or not the device is enabled. */ public Boolean isEnabled() { return this.enabled; } /** *

* A value between 0 and 1 inclusive, representing the fraction of life remaining for the device. *

* * @param remainingLife * A value between 0 and 1 inclusive, representing the fraction of life remaining for the device. */ public void setRemainingLife(Double remainingLife) { this.remainingLife = remainingLife; } /** *

* A value between 0 and 1 inclusive, representing the fraction of life remaining for the device. *

* * @return A value between 0 and 1 inclusive, representing the fraction of life remaining for the device. */ public Double getRemainingLife() { return this.remainingLife; } /** *

* A value between 0 and 1 inclusive, representing the fraction of life remaining for the device. *

* * @param remainingLife * A value between 0 and 1 inclusive, representing the fraction of life remaining for the device. * @return Returns a reference to this object so that method calls can be chained together. */ public DeviceDescription withRemainingLife(Double remainingLife) { setRemainingLife(remainingLife); return this; } /** *

* The type of the device, such as "button". *

* * @param type * The type of the device, such as "button". */ public void setType(String type) { this.type = type; } /** *

* The type of the device, such as "button". *

* * @return The type of the device, such as "button". */ public String getType() { return this.type; } /** *

* The type of the device, such as "button". *

* * @param type * The type of the device, such as "button". * @return Returns a reference to this object so that method calls can be chained together. */ public DeviceDescription withType(String type) { setType(type); return this; } /** *

* The tags currently associated with the AWS IoT 1-Click device. *

* * @return The tags currently associated with the AWS IoT 1-Click device. */ public java.util.Map getTags() { return tags; } /** *

* The tags currently associated with the AWS IoT 1-Click device. *

* * @param tags * The tags currently associated with the AWS IoT 1-Click device. */ public void setTags(java.util.Map tags) { this.tags = tags; } /** *

* The tags currently associated with the AWS IoT 1-Click device. *

* * @param tags * The tags currently associated with the AWS IoT 1-Click device. * @return Returns a reference to this object so that method calls can be chained together. */ public DeviceDescription withTags(java.util.Map tags) { setTags(tags); return this; } /** * Add a single Tags entry * * @see DeviceDescription#withTags * @returns a reference to this object so that method calls can be chained together. */ public DeviceDescription addTagsEntry(String key, String value) { if (null == this.tags) { this.tags = new java.util.HashMap(); } if (this.tags.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.tags.put(key, value); return this; } /** * Removes all the entries added into Tags. * * @return Returns a reference to this object so that method calls can be chained together. */ public DeviceDescription clearTagsEntries() { this.tags = null; 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 (getArn() != null) sb.append("Arn: ").append(getArn()).append(","); if (getAttributes() != null) sb.append("Attributes: ").append(getAttributes()).append(","); if (getDeviceId() != null) sb.append("DeviceId: ").append(getDeviceId()).append(","); if (getEnabled() != null) sb.append("Enabled: ").append(getEnabled()).append(","); if (getRemainingLife() != null) sb.append("RemainingLife: ").append(getRemainingLife()).append(","); if (getType() != null) sb.append("Type: ").append(getType()).append(","); if (getTags() != null) sb.append("Tags: ").append(getTags()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof DeviceDescription == false) return false; DeviceDescription other = (DeviceDescription) obj; if (other.getArn() == null ^ this.getArn() == null) return false; if (other.getArn() != null && other.getArn().equals(this.getArn()) == false) return false; if (other.getAttributes() == null ^ this.getAttributes() == null) return false; if (other.getAttributes() != null && other.getAttributes().equals(this.getAttributes()) == 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.getEnabled() == null ^ this.getEnabled() == null) return false; if (other.getEnabled() != null && other.getEnabled().equals(this.getEnabled()) == false) return false; if (other.getRemainingLife() == null ^ this.getRemainingLife() == null) return false; if (other.getRemainingLife() != null && other.getRemainingLife().equals(this.getRemainingLife()) == false) return false; if (other.getType() == null ^ this.getType() == null) return false; if (other.getType() != null && other.getType().equals(this.getType()) == false) return false; if (other.getTags() == null ^ this.getTags() == null) return false; if (other.getTags() != null && other.getTags().equals(this.getTags()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode()); hashCode = prime * hashCode + ((getAttributes() == null) ? 0 : getAttributes().hashCode()); hashCode = prime * hashCode + ((getDeviceId() == null) ? 0 : getDeviceId().hashCode()); hashCode = prime * hashCode + ((getEnabled() == null) ? 0 : getEnabled().hashCode()); hashCode = prime * hashCode + ((getRemainingLife() == null) ? 0 : getRemainingLife().hashCode()); hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode()); hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode()); return hashCode; } @Override public DeviceDescription clone() { try { return (DeviceDescription) 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.iot1clickdevices.model.transform.DeviceDescriptionMarshaller.getInstance().marshall(this, protocolMarshaller); } }