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

* Compliance information of one or more Config rules within a conformance pack. You can filter using Config rule names * and compliance types. *

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

* Name of the Config rule. *

*/ private String configRuleName; /** *

* Compliance of the Config rule. *

*/ private String complianceType; /** *

* Controls for the conformance pack. A control is a process to prevent or detect problems while meeting objectives. * A control can align with a specific compliance regime or map to internal controls defined by an organization. *

*/ private com.amazonaws.internal.SdkInternalList controls; /** *

* Name of the Config rule. *

* * @param configRuleName * Name of the Config rule. */ public void setConfigRuleName(String configRuleName) { this.configRuleName = configRuleName; } /** *

* Name of the Config rule. *

* * @return Name of the Config rule. */ public String getConfigRuleName() { return this.configRuleName; } /** *

* Name of the Config rule. *

* * @param configRuleName * Name of the Config rule. * @return Returns a reference to this object so that method calls can be chained together. */ public ConformancePackRuleCompliance withConfigRuleName(String configRuleName) { setConfigRuleName(configRuleName); return this; } /** *

* Compliance of the Config rule. *

* * @param complianceType * Compliance of the Config rule. * @see ConformancePackComplianceType */ public void setComplianceType(String complianceType) { this.complianceType = complianceType; } /** *

* Compliance of the Config rule. *

* * @return Compliance of the Config rule. * @see ConformancePackComplianceType */ public String getComplianceType() { return this.complianceType; } /** *

* Compliance of the Config rule. *

* * @param complianceType * Compliance of the Config rule. * @return Returns a reference to this object so that method calls can be chained together. * @see ConformancePackComplianceType */ public ConformancePackRuleCompliance withComplianceType(String complianceType) { setComplianceType(complianceType); return this; } /** *

* Compliance of the Config rule. *

* * @param complianceType * Compliance of the Config rule. * @return Returns a reference to this object so that method calls can be chained together. * @see ConformancePackComplianceType */ public ConformancePackRuleCompliance withComplianceType(ConformancePackComplianceType complianceType) { this.complianceType = complianceType.toString(); return this; } /** *

* Controls for the conformance pack. A control is a process to prevent or detect problems while meeting objectives. * A control can align with a specific compliance regime or map to internal controls defined by an organization. *

* * @return Controls for the conformance pack. A control is a process to prevent or detect problems while meeting * objectives. A control can align with a specific compliance regime or map to internal controls defined by * an organization. */ public java.util.List getControls() { if (controls == null) { controls = new com.amazonaws.internal.SdkInternalList(); } return controls; } /** *

* Controls for the conformance pack. A control is a process to prevent or detect problems while meeting objectives. * A control can align with a specific compliance regime or map to internal controls defined by an organization. *

* * @param controls * Controls for the conformance pack. A control is a process to prevent or detect problems while meeting * objectives. A control can align with a specific compliance regime or map to internal controls defined by * an organization. */ public void setControls(java.util.Collection controls) { if (controls == null) { this.controls = null; return; } this.controls = new com.amazonaws.internal.SdkInternalList(controls); } /** *

* Controls for the conformance pack. A control is a process to prevent or detect problems while meeting objectives. * A control can align with a specific compliance regime or map to internal controls defined by an organization. *

*

* 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 * Controls for the conformance pack. A control is a process to prevent or detect problems while meeting * objectives. A control can align with a specific compliance regime or map to internal controls defined by * an organization. * @return Returns a reference to this object so that method calls can be chained together. */ public ConformancePackRuleCompliance withControls(String... controls) { if (this.controls == null) { setControls(new com.amazonaws.internal.SdkInternalList(controls.length)); } for (String ele : controls) { this.controls.add(ele); } return this; } /** *

* Controls for the conformance pack. A control is a process to prevent or detect problems while meeting objectives. * A control can align with a specific compliance regime or map to internal controls defined by an organization. *

* * @param controls * Controls for the conformance pack. A control is a process to prevent or detect problems while meeting * objectives. A control can align with a specific compliance regime or map to internal controls defined by * an organization. * @return Returns a reference to this object so that method calls can be chained together. */ public ConformancePackRuleCompliance withControls(java.util.Collection controls) { setControls(controls); 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 (getConfigRuleName() != null) sb.append("ConfigRuleName: ").append(getConfigRuleName()).append(","); if (getComplianceType() != null) sb.append("ComplianceType: ").append(getComplianceType()).append(","); if (getControls() != null) sb.append("Controls: ").append(getControls()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ConformancePackRuleCompliance == false) return false; ConformancePackRuleCompliance other = (ConformancePackRuleCompliance) obj; if (other.getConfigRuleName() == null ^ this.getConfigRuleName() == null) return false; if (other.getConfigRuleName() != null && other.getConfigRuleName().equals(this.getConfigRuleName()) == false) return false; if (other.getComplianceType() == null ^ this.getComplianceType() == null) return false; if (other.getComplianceType() != null && other.getComplianceType().equals(this.getComplianceType()) == false) return false; if (other.getControls() == null ^ this.getControls() == null) return false; if (other.getControls() != null && other.getControls().equals(this.getControls()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getConfigRuleName() == null) ? 0 : getConfigRuleName().hashCode()); hashCode = prime * hashCode + ((getComplianceType() == null) ? 0 : getComplianceType().hashCode()); hashCode = prime * hashCode + ((getControls() == null) ? 0 : getControls().hashCode()); return hashCode; } @Override public ConformancePackRuleCompliance clone() { try { return (ConformancePackRuleCompliance) 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.config.model.transform.ConformancePackRuleComplianceMarshaller.getInstance().marshall(this, protocolMarshaller); } }