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

* The findings (results) of the audit. *

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

* A unique identifier for this set of audit findings. This identifier is used to apply mitigation tasks to one or * more sets of findings. *

*/ private String findingId; /** *

* The ID of the audit that generated this result (finding). *

*/ private String taskId; /** *

* The audit check that generated this result. *

*/ private String checkName; /** *

* The time the audit started. *

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

* The time the result (finding) was discovered. *

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

* The severity of the result (finding). *

*/ private String severity; /** *

* The resource that was found to be noncompliant with the audit check. *

*/ private NonCompliantResource nonCompliantResource; /** *

* The list of related resources. *

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

* The reason the resource was noncompliant. *

*/ private String reasonForNonCompliance; /** *

* A code that indicates the reason that the resource was noncompliant. *

*/ private String reasonForNonComplianceCode; /** *

* Indicates whether the audit finding was suppressed or not during reporting. *

*/ private Boolean isSuppressed; /** *

* A unique identifier for this set of audit findings. This identifier is used to apply mitigation tasks to one or * more sets of findings. *

* * @param findingId * A unique identifier for this set of audit findings. This identifier is used to apply mitigation tasks to * one or more sets of findings. */ public void setFindingId(String findingId) { this.findingId = findingId; } /** *

* A unique identifier for this set of audit findings. This identifier is used to apply mitigation tasks to one or * more sets of findings. *

* * @return A unique identifier for this set of audit findings. This identifier is used to apply mitigation tasks to * one or more sets of findings. */ public String getFindingId() { return this.findingId; } /** *

* A unique identifier for this set of audit findings. This identifier is used to apply mitigation tasks to one or * more sets of findings. *

* * @param findingId * A unique identifier for this set of audit findings. This identifier is used to apply mitigation tasks to * one or more sets of findings. * @return Returns a reference to this object so that method calls can be chained together. */ public AuditFinding withFindingId(String findingId) { setFindingId(findingId); return this; } /** *

* The ID of the audit that generated this result (finding). *

* * @param taskId * The ID of the audit that generated this result (finding). */ public void setTaskId(String taskId) { this.taskId = taskId; } /** *

* The ID of the audit that generated this result (finding). *

* * @return The ID of the audit that generated this result (finding). */ public String getTaskId() { return this.taskId; } /** *

* The ID of the audit that generated this result (finding). *

* * @param taskId * The ID of the audit that generated this result (finding). * @return Returns a reference to this object so that method calls can be chained together. */ public AuditFinding withTaskId(String taskId) { setTaskId(taskId); return this; } /** *

* The audit check that generated this result. *

* * @param checkName * The audit check that generated this result. */ public void setCheckName(String checkName) { this.checkName = checkName; } /** *

* The audit check that generated this result. *

* * @return The audit check that generated this result. */ public String getCheckName() { return this.checkName; } /** *

* The audit check that generated this result. *

* * @param checkName * The audit check that generated this result. * @return Returns a reference to this object so that method calls can be chained together. */ public AuditFinding withCheckName(String checkName) { setCheckName(checkName); return this; } /** *

* The time the audit started. *

* * @param taskStartTime * The time the audit started. */ public void setTaskStartTime(java.util.Date taskStartTime) { this.taskStartTime = taskStartTime; } /** *

* The time the audit started. *

* * @return The time the audit started. */ public java.util.Date getTaskStartTime() { return this.taskStartTime; } /** *

* The time the audit started. *

* * @param taskStartTime * The time the audit started. * @return Returns a reference to this object so that method calls can be chained together. */ public AuditFinding withTaskStartTime(java.util.Date taskStartTime) { setTaskStartTime(taskStartTime); return this; } /** *

* The time the result (finding) was discovered. *

* * @param findingTime * The time the result (finding) was discovered. */ public void setFindingTime(java.util.Date findingTime) { this.findingTime = findingTime; } /** *

* The time the result (finding) was discovered. *

* * @return The time the result (finding) was discovered. */ public java.util.Date getFindingTime() { return this.findingTime; } /** *

* The time the result (finding) was discovered. *

* * @param findingTime * The time the result (finding) was discovered. * @return Returns a reference to this object so that method calls can be chained together. */ public AuditFinding withFindingTime(java.util.Date findingTime) { setFindingTime(findingTime); return this; } /** *

* The severity of the result (finding). *

* * @param severity * The severity of the result (finding). * @see AuditFindingSeverity */ public void setSeverity(String severity) { this.severity = severity; } /** *

* The severity of the result (finding). *

* * @return The severity of the result (finding). * @see AuditFindingSeverity */ public String getSeverity() { return this.severity; } /** *

* The severity of the result (finding). *

* * @param severity * The severity of the result (finding). * @return Returns a reference to this object so that method calls can be chained together. * @see AuditFindingSeverity */ public AuditFinding withSeverity(String severity) { setSeverity(severity); return this; } /** *

* The severity of the result (finding). *

* * @param severity * The severity of the result (finding). * @return Returns a reference to this object so that method calls can be chained together. * @see AuditFindingSeverity */ public AuditFinding withSeverity(AuditFindingSeverity severity) { this.severity = severity.toString(); return this; } /** *

* The resource that was found to be noncompliant with the audit check. *

* * @param nonCompliantResource * The resource that was found to be noncompliant with the audit check. */ public void setNonCompliantResource(NonCompliantResource nonCompliantResource) { this.nonCompliantResource = nonCompliantResource; } /** *

* The resource that was found to be noncompliant with the audit check. *

* * @return The resource that was found to be noncompliant with the audit check. */ public NonCompliantResource getNonCompliantResource() { return this.nonCompliantResource; } /** *

* The resource that was found to be noncompliant with the audit check. *

* * @param nonCompliantResource * The resource that was found to be noncompliant with the audit check. * @return Returns a reference to this object so that method calls can be chained together. */ public AuditFinding withNonCompliantResource(NonCompliantResource nonCompliantResource) { setNonCompliantResource(nonCompliantResource); return this; } /** *

* The list of related resources. *

* * @return The list of related resources. */ public java.util.List getRelatedResources() { return relatedResources; } /** *

* The list of related resources. *

* * @param relatedResources * The list of related resources. */ public void setRelatedResources(java.util.Collection relatedResources) { if (relatedResources == null) { this.relatedResources = null; return; } this.relatedResources = new java.util.ArrayList(relatedResources); } /** *

* The list of related resources. *

*

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

* * @param relatedResources * The list of related resources. * @return Returns a reference to this object so that method calls can be chained together. */ public AuditFinding withRelatedResources(RelatedResource... relatedResources) { if (this.relatedResources == null) { setRelatedResources(new java.util.ArrayList(relatedResources.length)); } for (RelatedResource ele : relatedResources) { this.relatedResources.add(ele); } return this; } /** *

* The list of related resources. *

* * @param relatedResources * The list of related resources. * @return Returns a reference to this object so that method calls can be chained together. */ public AuditFinding withRelatedResources(java.util.Collection relatedResources) { setRelatedResources(relatedResources); return this; } /** *

* The reason the resource was noncompliant. *

* * @param reasonForNonCompliance * The reason the resource was noncompliant. */ public void setReasonForNonCompliance(String reasonForNonCompliance) { this.reasonForNonCompliance = reasonForNonCompliance; } /** *

* The reason the resource was noncompliant. *

* * @return The reason the resource was noncompliant. */ public String getReasonForNonCompliance() { return this.reasonForNonCompliance; } /** *

* The reason the resource was noncompliant. *

* * @param reasonForNonCompliance * The reason the resource was noncompliant. * @return Returns a reference to this object so that method calls can be chained together. */ public AuditFinding withReasonForNonCompliance(String reasonForNonCompliance) { setReasonForNonCompliance(reasonForNonCompliance); return this; } /** *

* A code that indicates the reason that the resource was noncompliant. *

* * @param reasonForNonComplianceCode * A code that indicates the reason that the resource was noncompliant. */ public void setReasonForNonComplianceCode(String reasonForNonComplianceCode) { this.reasonForNonComplianceCode = reasonForNonComplianceCode; } /** *

* A code that indicates the reason that the resource was noncompliant. *

* * @return A code that indicates the reason that the resource was noncompliant. */ public String getReasonForNonComplianceCode() { return this.reasonForNonComplianceCode; } /** *

* A code that indicates the reason that the resource was noncompliant. *

* * @param reasonForNonComplianceCode * A code that indicates the reason that the resource was noncompliant. * @return Returns a reference to this object so that method calls can be chained together. */ public AuditFinding withReasonForNonComplianceCode(String reasonForNonComplianceCode) { setReasonForNonComplianceCode(reasonForNonComplianceCode); return this; } /** *

* Indicates whether the audit finding was suppressed or not during reporting. *

* * @param isSuppressed * Indicates whether the audit finding was suppressed or not during reporting. */ public void setIsSuppressed(Boolean isSuppressed) { this.isSuppressed = isSuppressed; } /** *

* Indicates whether the audit finding was suppressed or not during reporting. *

* * @return Indicates whether the audit finding was suppressed or not during reporting. */ public Boolean getIsSuppressed() { return this.isSuppressed; } /** *

* Indicates whether the audit finding was suppressed or not during reporting. *

* * @param isSuppressed * Indicates whether the audit finding was suppressed or not during reporting. * @return Returns a reference to this object so that method calls can be chained together. */ public AuditFinding withIsSuppressed(Boolean isSuppressed) { setIsSuppressed(isSuppressed); return this; } /** *

* Indicates whether the audit finding was suppressed or not during reporting. *

* * @return Indicates whether the audit finding was suppressed or not during reporting. */ public Boolean isSuppressed() { return this.isSuppressed; } /** * 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 (getFindingId() != null) sb.append("FindingId: ").append(getFindingId()).append(","); if (getTaskId() != null) sb.append("TaskId: ").append(getTaskId()).append(","); if (getCheckName() != null) sb.append("CheckName: ").append(getCheckName()).append(","); if (getTaskStartTime() != null) sb.append("TaskStartTime: ").append(getTaskStartTime()).append(","); if (getFindingTime() != null) sb.append("FindingTime: ").append(getFindingTime()).append(","); if (getSeverity() != null) sb.append("Severity: ").append(getSeverity()).append(","); if (getNonCompliantResource() != null) sb.append("NonCompliantResource: ").append(getNonCompliantResource()).append(","); if (getRelatedResources() != null) sb.append("RelatedResources: ").append(getRelatedResources()).append(","); if (getReasonForNonCompliance() != null) sb.append("ReasonForNonCompliance: ").append(getReasonForNonCompliance()).append(","); if (getReasonForNonComplianceCode() != null) sb.append("ReasonForNonComplianceCode: ").append(getReasonForNonComplianceCode()).append(","); if (getIsSuppressed() != null) sb.append("IsSuppressed: ").append(getIsSuppressed()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AuditFinding == false) return false; AuditFinding other = (AuditFinding) obj; if (other.getFindingId() == null ^ this.getFindingId() == null) return false; if (other.getFindingId() != null && other.getFindingId().equals(this.getFindingId()) == false) return false; if (other.getTaskId() == null ^ this.getTaskId() == null) return false; if (other.getTaskId() != null && other.getTaskId().equals(this.getTaskId()) == false) return false; if (other.getCheckName() == null ^ this.getCheckName() == null) return false; if (other.getCheckName() != null && other.getCheckName().equals(this.getCheckName()) == false) return false; if (other.getTaskStartTime() == null ^ this.getTaskStartTime() == null) return false; if (other.getTaskStartTime() != null && other.getTaskStartTime().equals(this.getTaskStartTime()) == false) return false; if (other.getFindingTime() == null ^ this.getFindingTime() == null) return false; if (other.getFindingTime() != null && other.getFindingTime().equals(this.getFindingTime()) == false) return false; if (other.getSeverity() == null ^ this.getSeverity() == null) return false; if (other.getSeverity() != null && other.getSeverity().equals(this.getSeverity()) == false) return false; if (other.getNonCompliantResource() == null ^ this.getNonCompliantResource() == null) return false; if (other.getNonCompliantResource() != null && other.getNonCompliantResource().equals(this.getNonCompliantResource()) == false) return false; if (other.getRelatedResources() == null ^ this.getRelatedResources() == null) return false; if (other.getRelatedResources() != null && other.getRelatedResources().equals(this.getRelatedResources()) == false) return false; if (other.getReasonForNonCompliance() == null ^ this.getReasonForNonCompliance() == null) return false; if (other.getReasonForNonCompliance() != null && other.getReasonForNonCompliance().equals(this.getReasonForNonCompliance()) == false) return false; if (other.getReasonForNonComplianceCode() == null ^ this.getReasonForNonComplianceCode() == null) return false; if (other.getReasonForNonComplianceCode() != null && other.getReasonForNonComplianceCode().equals(this.getReasonForNonComplianceCode()) == false) return false; if (other.getIsSuppressed() == null ^ this.getIsSuppressed() == null) return false; if (other.getIsSuppressed() != null && other.getIsSuppressed().equals(this.getIsSuppressed()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getFindingId() == null) ? 0 : getFindingId().hashCode()); hashCode = prime * hashCode + ((getTaskId() == null) ? 0 : getTaskId().hashCode()); hashCode = prime * hashCode + ((getCheckName() == null) ? 0 : getCheckName().hashCode()); hashCode = prime * hashCode + ((getTaskStartTime() == null) ? 0 : getTaskStartTime().hashCode()); hashCode = prime * hashCode + ((getFindingTime() == null) ? 0 : getFindingTime().hashCode()); hashCode = prime * hashCode + ((getSeverity() == null) ? 0 : getSeverity().hashCode()); hashCode = prime * hashCode + ((getNonCompliantResource() == null) ? 0 : getNonCompliantResource().hashCode()); hashCode = prime * hashCode + ((getRelatedResources() == null) ? 0 : getRelatedResources().hashCode()); hashCode = prime * hashCode + ((getReasonForNonCompliance() == null) ? 0 : getReasonForNonCompliance().hashCode()); hashCode = prime * hashCode + ((getReasonForNonComplianceCode() == null) ? 0 : getReasonForNonComplianceCode().hashCode()); hashCode = prime * hashCode + ((getIsSuppressed() == null) ? 0 : getIsSuppressed().hashCode()); return hashCode; } @Override public AuditFinding clone() { try { return (AuditFinding) 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.iot.model.transform.AuditFindingMarshaller.getInstance().marshall(this, protocolMarshaller); } }