/* * 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.iotsitewise.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *

* Contains a summary of an asset. *

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

* The ID of the asset. *

*/ private String id; /** *

* The ARN of the asset, * which has the following format. *

*

* arn:${Partition}:iotsitewise:${Region}:${Account}:asset/${AssetId} *

*/ private String arn; /** *

* The name of the asset. *

*/ private String name; /** *

* The ID of the asset model used to create this asset. *

*/ private String assetModelId; /** *

* The date the asset was created, in Unix epoch time. *

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

* The date the asset was last updated, in Unix epoch time. *

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

* The current status of the asset. *

*/ private AssetStatus status; /** *

* A list of asset hierarchies that each contain a hierarchyId. A hierarchy specifies allowed * parent/child asset relationships. *

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

* A description for the asset. *

*/ private String description; /** *

* The ID of the asset. *

* * @param id * The ID of the asset. */ public void setId(String id) { this.id = id; } /** *

* The ID of the asset. *

* * @return The ID of the asset. */ public String getId() { return this.id; } /** *

* The ID of the asset. *

* * @param id * The ID of the asset. * @return Returns a reference to this object so that method calls can be chained together. */ public AssetSummary withId(String id) { setId(id); return this; } /** *

* The ARN of the asset, * which has the following format. *

*

* arn:${Partition}:iotsitewise:${Region}:${Account}:asset/${AssetId} *

* * @param arn * The ARN of the * asset, which has the following format.

*

* arn:${Partition}:iotsitewise:${Region}:${Account}:asset/${AssetId} */ public void setArn(String arn) { this.arn = arn; } /** *

* The ARN of the asset, * which has the following format. *

*

* arn:${Partition}:iotsitewise:${Region}:${Account}:asset/${AssetId} *

* * @return The ARN of the * asset, which has the following format.

*

* arn:${Partition}:iotsitewise:${Region}:${Account}:asset/${AssetId} */ public String getArn() { return this.arn; } /** *

* The ARN of the asset, * which has the following format. *

*

* arn:${Partition}:iotsitewise:${Region}:${Account}:asset/${AssetId} *

* * @param arn * The ARN of the * asset, which has the following format.

*

* arn:${Partition}:iotsitewise:${Region}:${Account}:asset/${AssetId} * @return Returns a reference to this object so that method calls can be chained together. */ public AssetSummary withArn(String arn) { setArn(arn); return this; } /** *

* The name of the asset. *

* * @param name * The name of the asset. */ public void setName(String name) { this.name = name; } /** *

* The name of the asset. *

* * @return The name of the asset. */ public String getName() { return this.name; } /** *

* The name of the asset. *

* * @param name * The name of the asset. * @return Returns a reference to this object so that method calls can be chained together. */ public AssetSummary withName(String name) { setName(name); return this; } /** *

* The ID of the asset model used to create this asset. *

* * @param assetModelId * The ID of the asset model used to create this asset. */ public void setAssetModelId(String assetModelId) { this.assetModelId = assetModelId; } /** *

* The ID of the asset model used to create this asset. *

* * @return The ID of the asset model used to create this asset. */ public String getAssetModelId() { return this.assetModelId; } /** *

* The ID of the asset model used to create this asset. *

* * @param assetModelId * The ID of the asset model used to create this asset. * @return Returns a reference to this object so that method calls can be chained together. */ public AssetSummary withAssetModelId(String assetModelId) { setAssetModelId(assetModelId); return this; } /** *

* The date the asset was created, in Unix epoch time. *

* * @param creationDate * The date the asset was created, in Unix epoch time. */ public void setCreationDate(java.util.Date creationDate) { this.creationDate = creationDate; } /** *

* The date the asset was created, in Unix epoch time. *

* * @return The date the asset was created, in Unix epoch time. */ public java.util.Date getCreationDate() { return this.creationDate; } /** *

* The date the asset was created, in Unix epoch time. *

* * @param creationDate * The date the asset was created, in Unix epoch time. * @return Returns a reference to this object so that method calls can be chained together. */ public AssetSummary withCreationDate(java.util.Date creationDate) { setCreationDate(creationDate); return this; } /** *

* The date the asset was last updated, in Unix epoch time. *

* * @param lastUpdateDate * The date the asset was last updated, in Unix epoch time. */ public void setLastUpdateDate(java.util.Date lastUpdateDate) { this.lastUpdateDate = lastUpdateDate; } /** *

* The date the asset was last updated, in Unix epoch time. *

* * @return The date the asset was last updated, in Unix epoch time. */ public java.util.Date getLastUpdateDate() { return this.lastUpdateDate; } /** *

* The date the asset was last updated, in Unix epoch time. *

* * @param lastUpdateDate * The date the asset was last updated, in Unix epoch time. * @return Returns a reference to this object so that method calls can be chained together. */ public AssetSummary withLastUpdateDate(java.util.Date lastUpdateDate) { setLastUpdateDate(lastUpdateDate); return this; } /** *

* The current status of the asset. *

* * @param status * The current status of the asset. */ public void setStatus(AssetStatus status) { this.status = status; } /** *

* The current status of the asset. *

* * @return The current status of the asset. */ public AssetStatus getStatus() { return this.status; } /** *

* The current status of the asset. *

* * @param status * The current status of the asset. * @return Returns a reference to this object so that method calls can be chained together. */ public AssetSummary withStatus(AssetStatus status) { setStatus(status); return this; } /** *

* A list of asset hierarchies that each contain a hierarchyId. A hierarchy specifies allowed * parent/child asset relationships. *

* * @return A list of asset hierarchies that each contain a hierarchyId. A hierarchy specifies allowed * parent/child asset relationships. */ public java.util.List getHierarchies() { return hierarchies; } /** *

* A list of asset hierarchies that each contain a hierarchyId. A hierarchy specifies allowed * parent/child asset relationships. *

* * @param hierarchies * A list of asset hierarchies that each contain a hierarchyId. A hierarchy specifies allowed * parent/child asset relationships. */ public void setHierarchies(java.util.Collection hierarchies) { if (hierarchies == null) { this.hierarchies = null; return; } this.hierarchies = new java.util.ArrayList(hierarchies); } /** *

* A list of asset hierarchies that each contain a hierarchyId. A hierarchy specifies allowed * parent/child asset relationships. *

*

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

* * @param hierarchies * A list of asset hierarchies that each contain a hierarchyId. A hierarchy specifies allowed * parent/child asset relationships. * @return Returns a reference to this object so that method calls can be chained together. */ public AssetSummary withHierarchies(AssetHierarchy... hierarchies) { if (this.hierarchies == null) { setHierarchies(new java.util.ArrayList(hierarchies.length)); } for (AssetHierarchy ele : hierarchies) { this.hierarchies.add(ele); } return this; } /** *

* A list of asset hierarchies that each contain a hierarchyId. A hierarchy specifies allowed * parent/child asset relationships. *

* * @param hierarchies * A list of asset hierarchies that each contain a hierarchyId. A hierarchy specifies allowed * parent/child asset relationships. * @return Returns a reference to this object so that method calls can be chained together. */ public AssetSummary withHierarchies(java.util.Collection hierarchies) { setHierarchies(hierarchies); return this; } /** *

* A description for the asset. *

* * @param description * A description for the asset. */ public void setDescription(String description) { this.description = description; } /** *

* A description for the asset. *

* * @return A description for the asset. */ public String getDescription() { return this.description; } /** *

* A description for the asset. *

* * @param description * A description for the asset. * @return Returns a reference to this object so that method calls can be chained together. */ public AssetSummary withDescription(String description) { setDescription(description); 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 (getId() != null) sb.append("Id: ").append(getId()).append(","); if (getArn() != null) sb.append("Arn: ").append(getArn()).append(","); if (getName() != null) sb.append("Name: ").append(getName()).append(","); if (getAssetModelId() != null) sb.append("AssetModelId: ").append(getAssetModelId()).append(","); if (getCreationDate() != null) sb.append("CreationDate: ").append(getCreationDate()).append(","); if (getLastUpdateDate() != null) sb.append("LastUpdateDate: ").append(getLastUpdateDate()).append(","); if (getStatus() != null) sb.append("Status: ").append(getStatus()).append(","); if (getHierarchies() != null) sb.append("Hierarchies: ").append(getHierarchies()).append(","); if (getDescription() != null) sb.append("Description: ").append(getDescription()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AssetSummary == false) return false; AssetSummary other = (AssetSummary) obj; if (other.getId() == null ^ this.getId() == null) return false; if (other.getId() != null && other.getId().equals(this.getId()) == false) return false; if (other.getArn() == null ^ this.getArn() == null) return false; if (other.getArn() != null && other.getArn().equals(this.getArn()) == false) return false; if (other.getName() == null ^ this.getName() == null) return false; if (other.getName() != null && other.getName().equals(this.getName()) == false) return false; if (other.getAssetModelId() == null ^ this.getAssetModelId() == null) return false; if (other.getAssetModelId() != null && other.getAssetModelId().equals(this.getAssetModelId()) == false) return false; if (other.getCreationDate() == null ^ this.getCreationDate() == null) return false; if (other.getCreationDate() != null && other.getCreationDate().equals(this.getCreationDate()) == false) return false; if (other.getLastUpdateDate() == null ^ this.getLastUpdateDate() == null) return false; if (other.getLastUpdateDate() != null && other.getLastUpdateDate().equals(this.getLastUpdateDate()) == false) return false; if (other.getStatus() == null ^ this.getStatus() == null) return false; if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false) return false; if (other.getHierarchies() == null ^ this.getHierarchies() == null) return false; if (other.getHierarchies() != null && other.getHierarchies().equals(this.getHierarchies()) == false) return false; if (other.getDescription() == null ^ this.getDescription() == null) return false; if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode()); hashCode = prime * hashCode + ((getArn() == null) ? 0 : getArn().hashCode()); hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode()); hashCode = prime * hashCode + ((getAssetModelId() == null) ? 0 : getAssetModelId().hashCode()); hashCode = prime * hashCode + ((getCreationDate() == null) ? 0 : getCreationDate().hashCode()); hashCode = prime * hashCode + ((getLastUpdateDate() == null) ? 0 : getLastUpdateDate().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getHierarchies() == null) ? 0 : getHierarchies().hashCode()); hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode()); return hashCode; } @Override public AssetSummary clone() { try { return (AssetSummary) 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.iotsitewise.model.transform.AssetSummaryMarshaller.getInstance().marshall(this, protocolMarshaller); } }