
com.amazonaws.services.accessanalyzer.model.ReasonSummary Maven / Gradle / Ivy
/*
* Copyright 2019-2024 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.accessanalyzer.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Contains information about the reasoning why a check for access passed or failed.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class ReasonSummary implements Serializable, Cloneable, StructuredPojo {
/**
*
* A description of the reasoning of a result of checking for access.
*
*/
private String description;
/**
*
* The index number of the reason statement.
*
*/
private Integer statementIndex;
/**
*
* The identifier for the reason statement.
*
*/
private String statementId;
/**
*
* A description of the reasoning of a result of checking for access.
*
*
* @param description
* A description of the reasoning of a result of checking for access.
*/
public void setDescription(String description) {
this.description = description;
}
/**
*
* A description of the reasoning of a result of checking for access.
*
*
* @return A description of the reasoning of a result of checking for access.
*/
public String getDescription() {
return this.description;
}
/**
*
* A description of the reasoning of a result of checking for access.
*
*
* @param description
* A description of the reasoning of a result of checking for access.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ReasonSummary withDescription(String description) {
setDescription(description);
return this;
}
/**
*
* The index number of the reason statement.
*
*
* @param statementIndex
* The index number of the reason statement.
*/
public void setStatementIndex(Integer statementIndex) {
this.statementIndex = statementIndex;
}
/**
*
* The index number of the reason statement.
*
*
* @return The index number of the reason statement.
*/
public Integer getStatementIndex() {
return this.statementIndex;
}
/**
*
* The index number of the reason statement.
*
*
* @param statementIndex
* The index number of the reason statement.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ReasonSummary withStatementIndex(Integer statementIndex) {
setStatementIndex(statementIndex);
return this;
}
/**
*
* The identifier for the reason statement.
*
*
* @param statementId
* The identifier for the reason statement.
*/
public void setStatementId(String statementId) {
this.statementId = statementId;
}
/**
*
* The identifier for the reason statement.
*
*
* @return The identifier for the reason statement.
*/
public String getStatementId() {
return this.statementId;
}
/**
*
* The identifier for the reason statement.
*
*
* @param statementId
* The identifier for the reason statement.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public ReasonSummary withStatementId(String statementId) {
setStatementId(statementId);
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 (getDescription() != null)
sb.append("Description: ").append(getDescription()).append(",");
if (getStatementIndex() != null)
sb.append("StatementIndex: ").append(getStatementIndex()).append(",");
if (getStatementId() != null)
sb.append("StatementId: ").append(getStatementId());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof ReasonSummary == false)
return false;
ReasonSummary other = (ReasonSummary) obj;
if (other.getDescription() == null ^ this.getDescription() == null)
return false;
if (other.getDescription() != null && other.getDescription().equals(this.getDescription()) == false)
return false;
if (other.getStatementIndex() == null ^ this.getStatementIndex() == null)
return false;
if (other.getStatementIndex() != null && other.getStatementIndex().equals(this.getStatementIndex()) == false)
return false;
if (other.getStatementId() == null ^ this.getStatementId() == null)
return false;
if (other.getStatementId() != null && other.getStatementId().equals(this.getStatementId()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getDescription() == null) ? 0 : getDescription().hashCode());
hashCode = prime * hashCode + ((getStatementIndex() == null) ? 0 : getStatementIndex().hashCode());
hashCode = prime * hashCode + ((getStatementId() == null) ? 0 : getStatementId().hashCode());
return hashCode;
}
@Override
public ReasonSummary clone() {
try {
return (ReasonSummary) 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.accessanalyzer.model.transform.ReasonSummaryMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}