
com.amazonaws.services.codecommit.model.Evaluation Maven / Gradle / Ivy
/*
* Copyright 2017-2022 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.codecommit.model;
import java.io.Serializable;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;
/**
*
* Returns information about the approval rules applied to a pull request and whether conditions have been met.
*
*
* @see AWS API
* Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class Evaluation implements Serializable, Cloneable, StructuredPojo {
/**
*
* Whether the state of the pull request is approved.
*
*/
private Boolean approved;
/**
*
* Whether the approval rule requirements for the pull request have been overridden and no longer need to be met.
*
*/
private Boolean overridden;
/**
*
* The names of the approval rules that have had their conditions met.
*
*/
private java.util.List approvalRulesSatisfied;
/**
*
* The names of the approval rules that have not had their conditions met.
*
*/
private java.util.List approvalRulesNotSatisfied;
/**
*
* Whether the state of the pull request is approved.
*
*
* @param approved
* Whether the state of the pull request is approved.
*/
public void setApproved(Boolean approved) {
this.approved = approved;
}
/**
*
* Whether the state of the pull request is approved.
*
*
* @return Whether the state of the pull request is approved.
*/
public Boolean getApproved() {
return this.approved;
}
/**
*
* Whether the state of the pull request is approved.
*
*
* @param approved
* Whether the state of the pull request is approved.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Evaluation withApproved(Boolean approved) {
setApproved(approved);
return this;
}
/**
*
* Whether the state of the pull request is approved.
*
*
* @return Whether the state of the pull request is approved.
*/
public Boolean isApproved() {
return this.approved;
}
/**
*
* Whether the approval rule requirements for the pull request have been overridden and no longer need to be met.
*
*
* @param overridden
* Whether the approval rule requirements for the pull request have been overridden and no longer need to be
* met.
*/
public void setOverridden(Boolean overridden) {
this.overridden = overridden;
}
/**
*
* Whether the approval rule requirements for the pull request have been overridden and no longer need to be met.
*
*
* @return Whether the approval rule requirements for the pull request have been overridden and no longer need to be
* met.
*/
public Boolean getOverridden() {
return this.overridden;
}
/**
*
* Whether the approval rule requirements for the pull request have been overridden and no longer need to be met.
*
*
* @param overridden
* Whether the approval rule requirements for the pull request have been overridden and no longer need to be
* met.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Evaluation withOverridden(Boolean overridden) {
setOverridden(overridden);
return this;
}
/**
*
* Whether the approval rule requirements for the pull request have been overridden and no longer need to be met.
*
*
* @return Whether the approval rule requirements for the pull request have been overridden and no longer need to be
* met.
*/
public Boolean isOverridden() {
return this.overridden;
}
/**
*
* The names of the approval rules that have had their conditions met.
*
*
* @return The names of the approval rules that have had their conditions met.
*/
public java.util.List getApprovalRulesSatisfied() {
return approvalRulesSatisfied;
}
/**
*
* The names of the approval rules that have had their conditions met.
*
*
* @param approvalRulesSatisfied
* The names of the approval rules that have had their conditions met.
*/
public void setApprovalRulesSatisfied(java.util.Collection approvalRulesSatisfied) {
if (approvalRulesSatisfied == null) {
this.approvalRulesSatisfied = null;
return;
}
this.approvalRulesSatisfied = new java.util.ArrayList(approvalRulesSatisfied);
}
/**
*
* The names of the approval rules that have had their conditions met.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setApprovalRulesSatisfied(java.util.Collection)} or
* {@link #withApprovalRulesSatisfied(java.util.Collection)} if you want to override the existing values.
*
*
* @param approvalRulesSatisfied
* The names of the approval rules that have had their conditions met.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Evaluation withApprovalRulesSatisfied(String... approvalRulesSatisfied) {
if (this.approvalRulesSatisfied == null) {
setApprovalRulesSatisfied(new java.util.ArrayList(approvalRulesSatisfied.length));
}
for (String ele : approvalRulesSatisfied) {
this.approvalRulesSatisfied.add(ele);
}
return this;
}
/**
*
* The names of the approval rules that have had their conditions met.
*
*
* @param approvalRulesSatisfied
* The names of the approval rules that have had their conditions met.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Evaluation withApprovalRulesSatisfied(java.util.Collection approvalRulesSatisfied) {
setApprovalRulesSatisfied(approvalRulesSatisfied);
return this;
}
/**
*
* The names of the approval rules that have not had their conditions met.
*
*
* @return The names of the approval rules that have not had their conditions met.
*/
public java.util.List getApprovalRulesNotSatisfied() {
return approvalRulesNotSatisfied;
}
/**
*
* The names of the approval rules that have not had their conditions met.
*
*
* @param approvalRulesNotSatisfied
* The names of the approval rules that have not had their conditions met.
*/
public void setApprovalRulesNotSatisfied(java.util.Collection approvalRulesNotSatisfied) {
if (approvalRulesNotSatisfied == null) {
this.approvalRulesNotSatisfied = null;
return;
}
this.approvalRulesNotSatisfied = new java.util.ArrayList(approvalRulesNotSatisfied);
}
/**
*
* The names of the approval rules that have not had their conditions met.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setApprovalRulesNotSatisfied(java.util.Collection)} or
* {@link #withApprovalRulesNotSatisfied(java.util.Collection)} if you want to override the existing values.
*
*
* @param approvalRulesNotSatisfied
* The names of the approval rules that have not had their conditions met.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Evaluation withApprovalRulesNotSatisfied(String... approvalRulesNotSatisfied) {
if (this.approvalRulesNotSatisfied == null) {
setApprovalRulesNotSatisfied(new java.util.ArrayList(approvalRulesNotSatisfied.length));
}
for (String ele : approvalRulesNotSatisfied) {
this.approvalRulesNotSatisfied.add(ele);
}
return this;
}
/**
*
* The names of the approval rules that have not had their conditions met.
*
*
* @param approvalRulesNotSatisfied
* The names of the approval rules that have not had their conditions met.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public Evaluation withApprovalRulesNotSatisfied(java.util.Collection approvalRulesNotSatisfied) {
setApprovalRulesNotSatisfied(approvalRulesNotSatisfied);
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 (getApproved() != null)
sb.append("Approved: ").append(getApproved()).append(",");
if (getOverridden() != null)
sb.append("Overridden: ").append(getOverridden()).append(",");
if (getApprovalRulesSatisfied() != null)
sb.append("ApprovalRulesSatisfied: ").append(getApprovalRulesSatisfied()).append(",");
if (getApprovalRulesNotSatisfied() != null)
sb.append("ApprovalRulesNotSatisfied: ").append(getApprovalRulesNotSatisfied());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof Evaluation == false)
return false;
Evaluation other = (Evaluation) obj;
if (other.getApproved() == null ^ this.getApproved() == null)
return false;
if (other.getApproved() != null && other.getApproved().equals(this.getApproved()) == false)
return false;
if (other.getOverridden() == null ^ this.getOverridden() == null)
return false;
if (other.getOverridden() != null && other.getOverridden().equals(this.getOverridden()) == false)
return false;
if (other.getApprovalRulesSatisfied() == null ^ this.getApprovalRulesSatisfied() == null)
return false;
if (other.getApprovalRulesSatisfied() != null && other.getApprovalRulesSatisfied().equals(this.getApprovalRulesSatisfied()) == false)
return false;
if (other.getApprovalRulesNotSatisfied() == null ^ this.getApprovalRulesNotSatisfied() == null)
return false;
if (other.getApprovalRulesNotSatisfied() != null && other.getApprovalRulesNotSatisfied().equals(this.getApprovalRulesNotSatisfied()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getApproved() == null) ? 0 : getApproved().hashCode());
hashCode = prime * hashCode + ((getOverridden() == null) ? 0 : getOverridden().hashCode());
hashCode = prime * hashCode + ((getApprovalRulesSatisfied() == null) ? 0 : getApprovalRulesSatisfied().hashCode());
hashCode = prime * hashCode + ((getApprovalRulesNotSatisfied() == null) ? 0 : getApprovalRulesNotSatisfied().hashCode());
return hashCode;
}
@Override
public Evaluation clone() {
try {
return (Evaluation) 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.codecommit.model.transform.EvaluationMarshaller.getInstance().marshall(this, protocolMarshaller);
}
}