/* * Copyright 2010-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; /** *
* The findings (results) of the audit. *
*/ public class AuditFinding implements Serializable { /** ** A unique identifier for this set of audit findings. This identifier is * used to apply mitigation tasks to one or more sets of findings. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9_-]+
*/
private String findingId;
/**
*
* The ID of the audit that generated this result (finding). *
*
* Constraints:
* Length: 1 - 40
* Pattern: [a-zA-Z0-9\-]+
*/
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). *
*
* Constraints:
* Allowed Values: CRITICAL, HIGH, MEDIUM, LOW
*/
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* 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. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9_-]+
*
* @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 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. *
*
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9_-]+
*
* @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. *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 1 - 128
* Pattern: [a-zA-Z0-9_-]+
*
* @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 A reference to this updated object so that method calls can be * chained together. */ public AuditFinding withFindingId(String findingId) { this.findingId = findingId; return this; } /** ** The ID of the audit that generated this result (finding). *
*
* Constraints:
* Length: 1 - 40
* Pattern: [a-zA-Z0-9\-]+
*
* @return
* The ID of the audit that generated this result (finding). *
*/ public String getTaskId() { return taskId; } /** ** The ID of the audit that generated this result (finding). *
*
* Constraints:
* Length: 1 - 40
* Pattern: [a-zA-Z0-9\-]+
*
* @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). *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Length: 1 - 40
* Pattern: [a-zA-Z0-9\-]+
*
* @param taskId
* The ID of the audit that generated this result (finding). *
* @return A reference to this updated object so that method calls can be * chained together. */ public AuditFinding withTaskId(String taskId) { this.taskId = taskId; return this; } /** ** The audit check that generated this result. *
* * @return* The audit check that generated this result. *
*/ public String getCheckName() { return checkName; } /** ** 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. *
** Returns a reference to this object so that method calls can be chained * together. * * @param checkName
* The audit check that generated this result. *
* @return A reference to this updated object so that method calls can be * chained together. */ public AuditFinding withCheckName(String checkName) { this.checkName = checkName; return this; } /** ** The time the audit started. *
* * @return* The time the audit started. *
*/ public java.util.Date getTaskStartTime() { return taskStartTime; } /** ** 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. *
** Returns a reference to this object so that method calls can be chained * together. * * @param taskStartTime
* The time the audit started. *
* @return A reference to this updated object so that method calls can be * chained together. */ public AuditFinding withTaskStartTime(java.util.Date taskStartTime) { this.taskStartTime = taskStartTime; return this; } /** ** The time the result (finding) was discovered. *
* * @return* The time the result (finding) was discovered. *
*/ public java.util.Date getFindingTime() { return findingTime; } /** ** 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. *
** Returns a reference to this object so that method calls can be chained * together. * * @param findingTime
* The time the result (finding) was discovered. *
* @return A reference to this updated object so that method calls can be * chained together. */ public AuditFinding withFindingTime(java.util.Date findingTime) { this.findingTime = findingTime; return this; } /** ** The severity of the result (finding). *
*
* Constraints:
* Allowed Values: CRITICAL, HIGH, MEDIUM, LOW
*
* @return
* The severity of the result (finding). *
* @see AuditFindingSeverity */ public String getSeverity() { return severity; } /** ** The severity of the result (finding). *
*
* Constraints:
* Allowed Values: CRITICAL, HIGH, MEDIUM, LOW
*
* @param severity
* The severity of the result (finding). *
* @see AuditFindingSeverity */ public void setSeverity(String severity) { this.severity = severity; } /** ** The severity of the result (finding). *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: CRITICAL, HIGH, MEDIUM, LOW
*
* @param severity
* The severity of the result (finding). *
* @return A reference to this updated object so that method calls can be * chained together. * @see AuditFindingSeverity */ public AuditFinding withSeverity(String severity) { this.severity = severity; return this; } /** ** The severity of the result (finding). *
*
* Constraints:
* Allowed Values: CRITICAL, HIGH, MEDIUM, LOW
*
* @param severity
* The severity of the result (finding). *
* @see AuditFindingSeverity */ public void setSeverity(AuditFindingSeverity severity) { this.severity = severity.toString(); } /** ** The severity of the result (finding). *
** Returns a reference to this object so that method calls can be chained * together. *
* Constraints:
* Allowed Values: CRITICAL, HIGH, MEDIUM, LOW
*
* @param severity
* The severity of the result (finding). *
* @return A reference to this updated 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. *
* * @return* The resource that was found to be noncompliant with the audit * check. *
*/ public NonCompliantResource getNonCompliantResource() { return 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. *
*/ public void setNonCompliantResource(NonCompliantResource nonCompliantResource) { this.nonCompliantResource = nonCompliantResource; } /** ** The resource that was found to be noncompliant with the audit check. *
** Returns a reference to this object so that method calls can be chained * together. * * @param nonCompliantResource
* The resource that was found to be noncompliant with the audit * check. *
* @return A reference to this updated object so that method calls can be * chained together. */ public AuditFinding withNonCompliantResource(NonCompliantResource nonCompliantResource) { this.nonCompliantResource = nonCompliantResource; return this; } /** ** The list of related resources. *
* * @return* The list of related resources. *
*/ public java.util.List* The list of related resources. *
* * @param relatedResources* The list of related resources. *
*/ public void setRelatedResources(java.util.Collection* The list of related resources. *
** Returns a reference to this object so that method calls can be chained * together. * * @param relatedResources
* The list of related resources. *
* @return A reference to this updated object so that method calls can be * chained together. */ public AuditFinding withRelatedResources(RelatedResource... relatedResources) { if (getRelatedResources() == null) { this.relatedResources = new java.util.ArrayList* The list of related resources. *
** Returns a reference to this object so that method calls can be chained * together. * * @param relatedResources
* The list of related resources. *
* @return A reference to this updated object so that method calls can be * chained together. */ public AuditFinding withRelatedResources(java.util.Collection* The reason the resource was noncompliant. *
* * @return* The reason the resource was noncompliant. *
*/ public String getReasonForNonCompliance() { return reasonForNonCompliance; } /** ** 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. *
** Returns a reference to this object so that method calls can be chained * together. * * @param reasonForNonCompliance
* The reason the resource was noncompliant. *
* @return A reference to this updated object so that method calls can be * chained together. */ public AuditFinding withReasonForNonCompliance(String reasonForNonCompliance) { this.reasonForNonCompliance = reasonForNonCompliance; return this; } /** ** 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 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. *
*/ public void setReasonForNonComplianceCode(String reasonForNonComplianceCode) { this.reasonForNonComplianceCode = reasonForNonComplianceCode; } /** ** A code that indicates the reason that the resource was noncompliant. *
** Returns a reference to this object so that method calls can be chained * together. * * @param reasonForNonComplianceCode
* A code that indicates the reason that the resource was * noncompliant. *
* @return A reference to this updated object so that method calls can be * chained together. */ public AuditFinding withReasonForNonComplianceCode(String reasonForNonComplianceCode) { this.reasonForNonComplianceCode = reasonForNonComplianceCode; 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 isIsSuppressed() { return 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 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. *
*/ public void setIsSuppressed(Boolean isSuppressed) { this.isSuppressed = isSuppressed; } /** ** Indicates whether the audit finding was suppressed or not during * reporting. *
** Returns a reference to this object so that method calls can be chained * together. * * @param isSuppressed
* Indicates whether the audit finding was suppressed or not * during reporting. *
* @return A reference to this updated object so that method calls can be * chained together. */ public AuditFinding withIsSuppressed(Boolean isSuppressed) { this.isSuppressed = isSuppressed; return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @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: " + getFindingId() + ","); if (getTaskId() != null) sb.append("taskId: " + getTaskId() + ","); if (getCheckName() != null) sb.append("checkName: " + getCheckName() + ","); if (getTaskStartTime() != null) sb.append("taskStartTime: " + getTaskStartTime() + ","); if (getFindingTime() != null) sb.append("findingTime: " + getFindingTime() + ","); if (getSeverity() != null) sb.append("severity: " + getSeverity() + ","); if (getNonCompliantResource() != null) sb.append("nonCompliantResource: " + getNonCompliantResource() + ","); if (getRelatedResources() != null) sb.append("relatedResources: " + getRelatedResources() + ","); if (getReasonForNonCompliance() != null) sb.append("reasonForNonCompliance: " + getReasonForNonCompliance() + ","); if (getReasonForNonComplianceCode() != null) sb.append("reasonForNonComplianceCode: " + getReasonForNonComplianceCode() + ","); if (getIsSuppressed() != null) sb.append("isSuppressed: " + getIsSuppressed()); sb.append("}"); return sb.toString(); } @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 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; } }