com.amazonaws.services.auditmanager.model.Control Maven / Gradle / Ivy
Show all versions of aws-java-sdk-auditmanager Show documentation
/*
* Copyright 2016-2021 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;
/**
*
* A control in Audit Manager.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Control implements Serializable, Cloneable, StructuredPojo {
/**
*
* The Amazon Resource Name (ARN) of the specified control.
*
*/
private String arn;
/**
*
* The unique identifier for the control.
*
*/
private String id;
/**
*
* The type of control, such as custom or standard.
*
*/
private String type;
/**
*
* The name of the specified control.
*
*/
private String name;
/**
*
* The description of the specified control.
*
*/
private String description;
/**
*
* The steps to follow to determine if the control has been satisfied.
*
*/
private String testingInformation;
/**
*
* The title of the action plan for remediating the control.
*
*/
private String actionPlanTitle;
/**
*
* The recommended actions to carry out if the control is not fulfilled.
*
*/
private String actionPlanInstructions;
/**
*
* The data source that determines from where Audit Manager collects evidence for the control.
*
*/
private String controlSources;
/**
*
* The data mapping sources for the specified control.
*
*/
private java.util.List controlMappingSources;
/**
*
* Specifies when the control was created.
*
*/
private java.util.Date createdAt;
/**
*
* Specifies when the control was most recently updated.
*
*/
private java.util.Date lastUpdatedAt;
/**
*
* The IAM user or role that created the control.
*
*/
private String createdBy;
/**
*
* The IAM user or role that most recently updated the control.
*
*/
private String lastUpdatedBy;
/**
*
* The tags associated with the control.
*
*/
private java.util.Map tags;
/**
*
* The Amazon Resource Name (ARN) of the specified control.
*
*
* @param arn
* The Amazon Resource Name (ARN) of the specified control.
*/
public void setArn(String arn) {
this.arn = arn;
}
/**
*
* The Amazon Resource Name (ARN) of the specified control.
*
*
* @return The Amazon Resource Name (ARN) of the specified control.
*/
public String getArn() {
return this.arn;
}
/**
*
* The Amazon Resource Name (ARN) of the specified control.
*
*
* @param arn
* The Amazon Resource Name (ARN) of the specified control.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Control withArn(String arn) {
setArn(arn);
return this;
}
/**
*
* The unique identifier for the control.
*
*
* @param id
* The unique identifier for the control.
*/
public void setId(String id) {
this.id = id;
}
/**
*
* The unique identifier for the control.
*
*
* @return The unique identifier for the control.
*/
public String getId() {
return this.id;
}
/**
*
* The unique identifier for the control.
*
*
* @param id
* The unique identifier for the control.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Control withId(String id) {
setId(id);
return this;
}
/**
*
* The type of control, such as custom or standard.
*
*
* @param type
* The type of control, such as custom or standard.
* @see ControlType
*/
public void setType(String type) {
this.type = type;
}
/**
*
* The type of control, such as custom or standard.
*
*
* @return The type of control, such as custom or standard.
* @see ControlType
*/
public String getType() {
return this.type;
}
/**
*
* The type of control, such as custom or standard.
*
*
* @param type
* The type of control, such as custom or standard.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ControlType
*/
public Control withType(String type) {
setType(type);
return this;
}
/**
*
* The type of control, such as custom or standard.
*
*
* @param type
* The type of control, such as custom or standard.
* @return Returns a reference to this object so that method calls can be chained together.
* @see ControlType
*/
public Control withType(ControlType type) {
this.type = type.toString();
return this;
}
/**
*
* The name of the specified control.
*
*
* @param name
* The name of the specified control.
*/
public void setName(String name) {
this.name = name;
}
/**
*
* The name of the specified control.
*
*
* @return The name of the specified control.
*/
public String getName() {
return this.name;
}
/**
*
* The name of the specified control.
*
*
* @param name
* The name of the specified control.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Control withName(String name) {
setName(name);
return this;
}
/**
*
* The description of the specified control.
*
*
* @param description
* The description of the specified control.
*/
public void setDescription(String description) {
this.description = description;
}
/**
*
* The description of the specified control.
*
*
* @return The description of the specified control.
*/
public String getDescription() {
return this.description;
}
/**
*
* The description of the specified control.
*
*
* @param description
* The description of the specified control.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Control withDescription(String description) {
setDescription(description);
return this;
}
/**
*
* The steps to follow to determine if the control has been satisfied.
*
*
* @param testingInformation
* The steps to follow to determine if the control has been satisfied.
*/
public void setTestingInformation(String testingInformation) {
this.testingInformation = testingInformation;
}
/**
*
* The steps to follow to determine if the control has been satisfied.
*
*
* @return The steps to follow to determine if the control has been satisfied.
*/
public String getTestingInformation() {
return this.testingInformation;
}
/**
*
* The steps to follow to determine if the control has been satisfied.
*
*
* @param testingInformation
* The steps to follow to determine if the control has been satisfied.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Control withTestingInformation(String testingInformation) {
setTestingInformation(testingInformation);
return this;
}
/**
*
* The title of the action plan for remediating the control.
*
*
* @param actionPlanTitle
* The title of the action plan for remediating the control.
*/
public void setActionPlanTitle(String actionPlanTitle) {
this.actionPlanTitle = actionPlanTitle;
}
/**
*
* The title of the action plan for remediating the control.
*
*
* @return The title of the action plan for remediating the control.
*/
public String getActionPlanTitle() {
return this.actionPlanTitle;
}
/**
*
* The title of the action plan for remediating the control.
*
*
* @param actionPlanTitle
* The title of the action plan for remediating the control.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Control withActionPlanTitle(String actionPlanTitle) {
setActionPlanTitle(actionPlanTitle);
return this;
}
/**
*
* The recommended actions to carry out if the control is not fulfilled.
*
*
* @param actionPlanInstructions
* The recommended actions to carry out if the control is not fulfilled.
*/
public void setActionPlanInstructions(String actionPlanInstructions) {
this.actionPlanInstructions = actionPlanInstructions;
}
/**
*
* The recommended actions to carry out if the control is not fulfilled.
*
*
* @return The recommended actions to carry out if the control is not fulfilled.
*/
public String getActionPlanInstructions() {
return this.actionPlanInstructions;
}
/**
*
* The recommended actions to carry out if the control is not fulfilled.
*
*
* @param actionPlanInstructions
* The recommended actions to carry out if the control is not fulfilled.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Control withActionPlanInstructions(String actionPlanInstructions) {
setActionPlanInstructions(actionPlanInstructions);
return this;
}
/**
*
* The data source that determines from where Audit Manager collects evidence for the control.
*
*
* @param controlSources
* The data source that determines from where Audit Manager collects evidence for the control.
*/
public void setControlSources(String controlSources) {
this.controlSources = controlSources;
}
/**
*
* The data source that determines from where Audit Manager collects evidence for the control.
*
*
* @return The data source that determines from where Audit Manager collects evidence for the control.
*/
public String getControlSources() {
return this.controlSources;
}
/**
*
* The data source that determines from where Audit Manager collects evidence for the control.
*
*
* @param controlSources
* The data source that determines from where Audit Manager collects evidence for the control.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Control withControlSources(String controlSources) {
setControlSources(controlSources);
return this;
}
/**
*
* The data mapping sources for the specified control.
*
*
* @return The data mapping sources for the specified control.
*/
public java.util.List getControlMappingSources() {
return controlMappingSources;
}
/**
*
* The data mapping sources for the specified control.
*
*
* @param controlMappingSources
* The data mapping sources for the specified control.
*/
public void setControlMappingSources(java.util.Collection controlMappingSources) {
if (controlMappingSources == null) {
this.controlMappingSources = null;
return;
}
this.controlMappingSources = new java.util.ArrayList(controlMappingSources);
}
/**
*
* The data mapping sources for the specified control.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setControlMappingSources(java.util.Collection)} or
* {@link #withControlMappingSources(java.util.Collection)} if you want to override the existing values.
*
*
* @param controlMappingSources
* The data mapping sources for the specified control.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Control withControlMappingSources(ControlMappingSource... controlMappingSources) {
if (this.controlMappingSources == null) {
setControlMappingSources(new java.util.ArrayList(controlMappingSources.length));
}
for (ControlMappingSource ele : controlMappingSources) {
this.controlMappingSources.add(ele);
}
return this;
}
/**
*
* The data mapping sources for the specified control.
*
*
* @param controlMappingSources
* The data mapping sources for the specified control.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Control withControlMappingSources(java.util.Collection controlMappingSources) {
setControlMappingSources(controlMappingSources);
return this;
}
/**
*
* Specifies when the control was created.
*
*
* @param createdAt
* Specifies when the control was created.
*/
public void setCreatedAt(java.util.Date createdAt) {
this.createdAt = createdAt;
}
/**
*
* Specifies when the control was created.
*
*
* @return Specifies when the control was created.
*/
public java.util.Date getCreatedAt() {
return this.createdAt;
}
/**
*
* Specifies when the control was created.
*
*
* @param createdAt
* Specifies when the control was created.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Control withCreatedAt(java.util.Date createdAt) {
setCreatedAt(createdAt);
return this;
}
/**
*
* Specifies when the control was most recently updated.
*
*
* @param lastUpdatedAt
* Specifies when the control was most recently updated.
*/
public void setLastUpdatedAt(java.util.Date lastUpdatedAt) {
this.lastUpdatedAt = lastUpdatedAt;
}
/**
*
* Specifies when the control was most recently updated.
*
*
* @return Specifies when the control was most recently updated.
*/
public java.util.Date getLastUpdatedAt() {
return this.lastUpdatedAt;
}
/**
*
* Specifies when the control was most recently updated.
*
*
* @param lastUpdatedAt
* Specifies when the control was most recently updated.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Control withLastUpdatedAt(java.util.Date lastUpdatedAt) {
setLastUpdatedAt(lastUpdatedAt);
return this;
}
/**
*
* The IAM user or role that created the control.
*
*
* @param createdBy
* The IAM user or role that created the control.
*/
public void setCreatedBy(String createdBy) {
this.createdBy = createdBy;
}
/**
*
* The IAM user or role that created the control.
*
*
* @return The IAM user or role that created the control.
*/
public String getCreatedBy() {
return this.createdBy;
}
/**
*
* The IAM user or role that created the control.
*
*
* @param createdBy
* The IAM user or role that created the control.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Control withCreatedBy(String createdBy) {
setCreatedBy(createdBy);
return this;
}
/**
*
* The IAM user or role that most recently updated the control.
*
*
* @param lastUpdatedBy
* The IAM user or role that most recently updated the control.
*/
public void setLastUpdatedBy(String lastUpdatedBy) {
this.lastUpdatedBy = lastUpdatedBy;
}
/**
*
* The IAM user or role that most recently updated the control.
*
*
* @return The IAM user or role that most recently updated the control.
*/
public String getLastUpdatedBy() {
return this.lastUpdatedBy;
}
/**
*
* The IAM user or role that most recently updated the control.
*
*
* @param lastUpdatedBy
* The IAM user or role that most recently updated the control.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Control withLastUpdatedBy(String lastUpdatedBy) {
setLastUpdatedBy(lastUpdatedBy);
return this;
}
/**
*
* The tags associated with the control.
*
*
* @return The tags associated with the control.
*/
public java.util.Map getTags() {
return tags;
}
/**
*
* The tags associated with the control.
*
*
* @param tags
* The tags associated with the control.
*/
public void setTags(java.util.Map tags) {
this.tags = tags;
}
/**
*
* The tags associated with the control.
*
*
* @param tags
* The tags associated with the control.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Control withTags(java.util.Map tags) {
setTags(tags);
return this;
}
/**
* Add a single Tags entry
*
* @see Control#withTags
* @returns a reference to this object so that method calls can be chained together.
*/
public Control 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 Control 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 (getId() != null)
sb.append("Id: ").append(getId()).append(",");
if (getType() != null)
sb.append("Type: ").append(getType()).append(",");
if (getName() != null)
sb.append("Name: ").append(getName()).append(",");
if (getDescription() != null)
sb.append("Description: ").append(getDescription()).append(",");
if (getTestingInformation() != null)
sb.append("TestingInformation: ").append(getTestingInformation()).append(",");
if (getActionPlanTitle() != null)
sb.append("ActionPlanTitle: ").append(getActionPlanTitle()).append(",");
if (getActionPlanInstructions() != null)
sb.append("ActionPlanInstructions: ").append(getActionPlanInstructions()).append(",");
if (getControlSources() != null)
sb.append("ControlSources: ").append(getControlSources()).append(",");
if (getControlMappingSources() != null)
sb.append("ControlMappingSources: ").append(getControlMappingSources()).append(",");
if (getCreatedAt() != null)
sb.append("CreatedAt: ").append(getCreatedAt()).append(",");
if (getLastUpdatedAt() != null)
sb.append("LastUpdatedAt: ").append(getLastUpdatedAt()).append(",");
if (getCreatedBy() != null)
sb.append("CreatedBy: ").append(getCreatedBy()).append(",");
if (getLastUpdatedBy() != null)
sb.append("LastUpdatedBy: ").append(getLastUpdatedBy()).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 Control == false)
return false;
Control other = (Control) obj;
if (other.getArn() == null ^ this.getArn() == null)
return false;
if (other.getArn() != null && other.getArn().equals(this.getArn()) == false)
return false;
if (other.getId() == null ^ this.getId() == null)
return false;
if (other.getId() != null && other.getId().equals(this.getId()) == 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.getName() == null ^ this.getName() == null)
return false;
if (other.getName() != null && other.getName().equals(this.getName()) == 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.getTestingInformation() == null ^ this.getTestingInformation() == null)
return false;
if (other.getTestingInformation() != null && other.getTestingInformation().equals(this.getTestingInformation()) == false)
return false;
if (other.getActionPlanTitle() == null ^ this.getActionPlanTitle() == null)
return false;
if (other.getActionPlanTitle() != null && other.getActionPlanTitle().equals(this.getActionPlanTitle()) == false)
return false;
if (other.getActionPlanInstructions() == null ^ this.getActionPlanInstructions() == null)
return false;
if (other.getActionPlanInstructions() != null && other.getActionPlanInstructions().equals(this.getActionPlanInstructions()) == false)
return false;
if (other.getControlSources() == null ^ this.getControlSources() == null)
return false;
if (other.getControlSources() != null && other.getControlSources().equals(this.getControlSources()) == false)
return false;
if (other.getControlMappingSources() == null ^ this.getControlMappingSources() == null)
return false;
if (other.getControlMappingSources() != null && other.getControlMappingSources().equals(this.getControlMappingSources()) == false)
return false;
if (other.getCreatedAt() == null ^ this.getCreatedAt() == null)
return false;
if (other.getCreatedAt() != null && other.getCreatedAt().equals(this.getCreatedAt()) == false)
return false;
if (other.getLastUpdatedAt() == null ^ this.getLastUpdatedAt() == null)
return false;
if (other.getLastUpdatedAt() != null && other.getLastUpdatedAt().equals(this.getLastUpdatedAt()) == false)
return false;
if (other.getCreatedBy() == null ^ this.getCreatedBy() == null)
return false;
if (other.getCreatedBy() != null && other.getCreatedBy().equals(this.getCreatedBy()) == false)
return false;
if (other.getLastUpdatedBy() == null ^ this.getLastUpdatedBy() == null)
return false;
if (other.getLastUpdatedBy() != null && other.getLastUpdatedBy().equals(this.getLastUpdatedBy()) == 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 + ((getId() == null) ? 0 : getId().hashCode());
hashCode = prime * hashCode + ((getType() == null) ? 0 : getType().hashCode());
hashCode = prime * hashCode + ((getName() == null) ? 0 : getName().hashCode());
hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode());
hashCode = prime * hashCode + ((getTestingInformation() == null) ? 0 : getTestingInformation().hashCode());
hashCode = prime * hashCode + ((getActionPlanTitle() == null) ? 0 : getActionPlanTitle().hashCode());
hashCode = prime * hashCode + ((getActionPlanInstructions() == null) ? 0 : getActionPlanInstructions().hashCode());
hashCode = prime * hashCode + ((getControlSources() == null) ? 0 : getControlSources().hashCode());
hashCode = prime * hashCode + ((getControlMappingSources() == null) ? 0 : getControlMappingSources().hashCode());
hashCode = prime * hashCode + ((getCreatedAt() == null) ? 0 : getCreatedAt().hashCode());
hashCode = prime * hashCode + ((getLastUpdatedAt() == null) ? 0 : getLastUpdatedAt().hashCode());
hashCode = prime * hashCode + ((getCreatedBy() == null) ? 0 : getCreatedBy().hashCode());
hashCode = prime * hashCode + ((getLastUpdatedBy() == null) ? 0 : getLastUpdatedBy().hashCode());
hashCode = prime * hashCode + ((getTags() == null) ? 0 : getTags().hashCode());
return hashCode;
}
@Override
public Control clone() {
try {
return (Control) 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.ControlMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}