/* * 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.auditmanager.model; import java.io.Serializable; import javax.annotation.Generated; import com.amazonaws.protocol.StructuredPojo; import com.amazonaws.protocol.ProtocolMarshaller; /** *
* Represents a set of controls in an Audit Manager assessment. *
* * @see AWS * API Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class AssessmentControlSet implements Serializable, Cloneable, StructuredPojo { /** ** The identifier of the control set in the assessment. This is the control set name in a plain string format. *
*/ private String id; /** ** The description for the control set. *
*/ private String description; /** ** The current status of the control set. *
*/ private String status; /** ** The roles that are associated with the control set. *
*/ private java.util.List* The list of controls that's contained with the control set. *
*/ private java.util.List* The delegations that are associated with the control set. *
*/ private java.util.List* The total number of evidence objects that are retrieved automatically for the control set. *
*/ private Integer systemEvidenceCount; /** ** The total number of evidence objects that are uploaded manually to the control set. *
*/ private Integer manualEvidenceCount; /** ** The identifier of the control set in the assessment. This is the control set name in a plain string format. *
* * @param id * The identifier of the control set in the assessment. This is the control set name in a plain string * format. */ public void setId(String id) { this.id = id; } /** ** The identifier of the control set in the assessment. This is the control set name in a plain string format. *
* * @return The identifier of the control set in the assessment. This is the control set name in a plain string * format. */ public String getId() { return this.id; } /** ** The identifier of the control set in the assessment. This is the control set name in a plain string format. *
* * @param id * The identifier of the control set in the assessment. This is the control set name in a plain string * format. * @return Returns a reference to this object so that method calls can be chained together. */ public AssessmentControlSet withId(String id) { setId(id); return this; } /** ** The description for the control set. *
* * @param description * The description for the control set. */ public void setDescription(String description) { this.description = description; } /** ** The description for the control set. *
* * @return The description for the control set. */ public String getDescription() { return this.description; } /** ** The description for the control set. *
* * @param description * The description for the control set. * @return Returns a reference to this object so that method calls can be chained together. */ public AssessmentControlSet withDescription(String description) { setDescription(description); return this; } /** ** The current status of the control set. *
* * @param status * The current status of the control set. * @see ControlSetStatus */ public void setStatus(String status) { this.status = status; } /** ** The current status of the control set. *
* * @return The current status of the control set. * @see ControlSetStatus */ public String getStatus() { return this.status; } /** ** The current status of the control set. *
* * @param status * The current status of the control set. * @return Returns a reference to this object so that method calls can be chained together. * @see ControlSetStatus */ public AssessmentControlSet withStatus(String status) { setStatus(status); return this; } /** ** The current status of the control set. *
* * @param status * The current status of the control set. * @return Returns a reference to this object so that method calls can be chained together. * @see ControlSetStatus */ public AssessmentControlSet withStatus(ControlSetStatus status) { this.status = status.toString(); return this; } /** ** The roles that are associated with the control set. *
* * @return The roles that are associated with the control set. */ public java.util.List* The roles that are associated with the control set. *
* * @param roles * The roles that are associated with the control set. */ public void setRoles(java.util.Collection* The roles that are associated with the control set. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setRoles(java.util.Collection)} or {@link #withRoles(java.util.Collection)} if you want to override the * existing values. *
* * @param roles * The roles that are associated with the control set. * @return Returns a reference to this object so that method calls can be chained together. */ public AssessmentControlSet withRoles(Role... roles) { if (this.roles == null) { setRoles(new java.util.ArrayList* The roles that are associated with the control set. *
* * @param roles * The roles that are associated with the control set. * @return Returns a reference to this object so that method calls can be chained together. */ public AssessmentControlSet withRoles(java.util.Collection* The list of controls that's contained with the control set. *
* * @return The list of controls that's contained with the control set. */ public java.util.List* The list of controls that's contained with the control set. *
* * @param controls * The list of controls that's contained with the control set. */ public void setControls(java.util.Collection* The list of controls that's contained with the control set. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setControls(java.util.Collection)} or {@link #withControls(java.util.Collection)} if you want to override * the existing values. *
* * @param controls * The list of controls that's contained with the control set. * @return Returns a reference to this object so that method calls can be chained together. */ public AssessmentControlSet withControls(AssessmentControl... controls) { if (this.controls == null) { setControls(new java.util.ArrayList* The list of controls that's contained with the control set. *
* * @param controls * The list of controls that's contained with the control set. * @return Returns a reference to this object so that method calls can be chained together. */ public AssessmentControlSet withControls(java.util.Collection* The delegations that are associated with the control set. *
* * @return The delegations that are associated with the control set. */ public java.util.List* The delegations that are associated with the control set. *
* * @param delegations * The delegations that are associated with the control set. */ public void setDelegations(java.util.Collection* The delegations that are associated with the control set. *
** NOTE: This method appends the values to the existing list (if any). Use * {@link #setDelegations(java.util.Collection)} or {@link #withDelegations(java.util.Collection)} if you want to * override the existing values. *
* * @param delegations * The delegations that are associated with the control set. * @return Returns a reference to this object so that method calls can be chained together. */ public AssessmentControlSet withDelegations(Delegation... delegations) { if (this.delegations == null) { setDelegations(new java.util.ArrayList* The delegations that are associated with the control set. *
* * @param delegations * The delegations that are associated with the control set. * @return Returns a reference to this object so that method calls can be chained together. */ public AssessmentControlSet withDelegations(java.util.Collection* The total number of evidence objects that are retrieved automatically for the control set. *
* * @param systemEvidenceCount * The total number of evidence objects that are retrieved automatically for the control set. */ public void setSystemEvidenceCount(Integer systemEvidenceCount) { this.systemEvidenceCount = systemEvidenceCount; } /** ** The total number of evidence objects that are retrieved automatically for the control set. *
* * @return The total number of evidence objects that are retrieved automatically for the control set. */ public Integer getSystemEvidenceCount() { return this.systemEvidenceCount; } /** ** The total number of evidence objects that are retrieved automatically for the control set. *
* * @param systemEvidenceCount * The total number of evidence objects that are retrieved automatically for the control set. * @return Returns a reference to this object so that method calls can be chained together. */ public AssessmentControlSet withSystemEvidenceCount(Integer systemEvidenceCount) { setSystemEvidenceCount(systemEvidenceCount); return this; } /** ** The total number of evidence objects that are uploaded manually to the control set. *
* * @param manualEvidenceCount * The total number of evidence objects that are uploaded manually to the control set. */ public void setManualEvidenceCount(Integer manualEvidenceCount) { this.manualEvidenceCount = manualEvidenceCount; } /** ** The total number of evidence objects that are uploaded manually to the control set. *
* * @return The total number of evidence objects that are uploaded manually to the control set. */ public Integer getManualEvidenceCount() { return this.manualEvidenceCount; } /** ** The total number of evidence objects that are uploaded manually to the control set. *
* * @param manualEvidenceCount * The total number of evidence objects that are uploaded manually to the control set. * @return Returns a reference to this object so that method calls can be chained together. */ public AssessmentControlSet withManualEvidenceCount(Integer manualEvidenceCount) { setManualEvidenceCount(manualEvidenceCount); 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 (getDescription() != null) sb.append("Description: ").append(getDescription()).append(","); if (getStatus() != null) sb.append("Status: ").append(getStatus()).append(","); if (getRoles() != null) sb.append("Roles: ").append(getRoles()).append(","); if (getControls() != null) sb.append("Controls: ").append(getControls()).append(","); if (getDelegations() != null) sb.append("Delegations: ").append(getDelegations()).append(","); if (getSystemEvidenceCount() != null) sb.append("SystemEvidenceCount: ").append(getSystemEvidenceCount()).append(","); if (getManualEvidenceCount() != null) sb.append("ManualEvidenceCount: ").append(getManualEvidenceCount()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof AssessmentControlSet == false) return false; AssessmentControlSet other = (AssessmentControlSet) obj; if (other.getId() == null ^ this.getId() == null) return false; if (other.getId() != null && other.getId().equals(this.getId()) == false) return false; if (other.getDescription() == null ^ this.getDescription() == null) return false; if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == 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.getRoles() == null ^ this.getRoles() == null) return false; if (other.getRoles() != null && other.getRoles().equals(this.getRoles()) == false) return false; if (other.getControls() == null ^ this.getControls() == null) return false; if (other.getControls() != null && other.getControls().equals(this.getControls()) == false) return false; if (other.getDelegations() == null ^ this.getDelegations() == null) return false; if (other.getDelegations() != null && other.getDelegations().equals(this.getDelegations()) == false) return false; if (other.getSystemEvidenceCount() == null ^ this.getSystemEvidenceCount() == null) return false; if (other.getSystemEvidenceCount() != null && other.getSystemEvidenceCount().equals(this.getSystemEvidenceCount()) == false) return false; if (other.getManualEvidenceCount() == null ^ this.getManualEvidenceCount() == null) return false; if (other.getManualEvidenceCount() != null && other.getManualEvidenceCount().equals(this.getManualEvidenceCount()) == 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 + ((getDescription() == null) ? 0 : getDescription().hashCode()); hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode()); hashCode = prime * hashCode + ((getRoles() == null) ? 0 : getRoles().hashCode()); hashCode = prime * hashCode + ((getControls() == null) ? 0 : getControls().hashCode()); hashCode = prime * hashCode + ((getDelegations() == null) ? 0 : getDelegations().hashCode()); hashCode = prime * hashCode + ((getSystemEvidenceCount() == null) ? 0 : getSystemEvidenceCount().hashCode()); hashCode = prime * hashCode + ((getManualEvidenceCount() == null) ? 0 : getManualEvidenceCount().hashCode()); return hashCode; } @Override public AssessmentControlSet clone() { try { return (AssessmentControlSet) 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.auditmanager.model.transform.AssessmentControlSetMarshaller.getInstance().marshall(this, protocolMarshaller); } }