
com.amazonaws.services.codecommit.model.BatchDescribeMergeConflictsResult 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;
/**
*
* @see AWS API Documentation
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class BatchDescribeMergeConflictsResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable {
/**
*
* A list of conflicts for each file, including the conflict metadata and the hunks of the differences between the
* files.
*
*/
private java.util.List conflicts;
/**
*
* An enumeration token that can be used in a request to return the next batch of the results.
*
*/
private String nextToken;
/**
*
* A list of any errors returned while describing the merge conflicts for each file.
*
*/
private java.util.List errors;
/**
*
* The commit ID of the destination commit specifier that was used in the merge evaluation.
*
*/
private String destinationCommitId;
/**
*
* The commit ID of the source commit specifier that was used in the merge evaluation.
*
*/
private String sourceCommitId;
/**
*
* The commit ID of the merge base.
*
*/
private String baseCommitId;
/**
*
* A list of conflicts for each file, including the conflict metadata and the hunks of the differences between the
* files.
*
*
* @return A list of conflicts for each file, including the conflict metadata and the hunks of the differences
* between the files.
*/
public java.util.List getConflicts() {
return conflicts;
}
/**
*
* A list of conflicts for each file, including the conflict metadata and the hunks of the differences between the
* files.
*
*
* @param conflicts
* A list of conflicts for each file, including the conflict metadata and the hunks of the differences
* between the files.
*/
public void setConflicts(java.util.Collection conflicts) {
if (conflicts == null) {
this.conflicts = null;
return;
}
this.conflicts = new java.util.ArrayList(conflicts);
}
/**
*
* A list of conflicts for each file, including the conflict metadata and the hunks of the differences between the
* files.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setConflicts(java.util.Collection)} or {@link #withConflicts(java.util.Collection)} if you want to
* override the existing values.
*
*
* @param conflicts
* A list of conflicts for each file, including the conflict metadata and the hunks of the differences
* between the files.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BatchDescribeMergeConflictsResult withConflicts(Conflict... conflicts) {
if (this.conflicts == null) {
setConflicts(new java.util.ArrayList(conflicts.length));
}
for (Conflict ele : conflicts) {
this.conflicts.add(ele);
}
return this;
}
/**
*
* A list of conflicts for each file, including the conflict metadata and the hunks of the differences between the
* files.
*
*
* @param conflicts
* A list of conflicts for each file, including the conflict metadata and the hunks of the differences
* between the files.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BatchDescribeMergeConflictsResult withConflicts(java.util.Collection conflicts) {
setConflicts(conflicts);
return this;
}
/**
*
* An enumeration token that can be used in a request to return the next batch of the results.
*
*
* @param nextToken
* An enumeration token that can be used in a request to return the next batch of the results.
*/
public void setNextToken(String nextToken) {
this.nextToken = nextToken;
}
/**
*
* An enumeration token that can be used in a request to return the next batch of the results.
*
*
* @return An enumeration token that can be used in a request to return the next batch of the results.
*/
public String getNextToken() {
return this.nextToken;
}
/**
*
* An enumeration token that can be used in a request to return the next batch of the results.
*
*
* @param nextToken
* An enumeration token that can be used in a request to return the next batch of the results.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BatchDescribeMergeConflictsResult withNextToken(String nextToken) {
setNextToken(nextToken);
return this;
}
/**
*
* A list of any errors returned while describing the merge conflicts for each file.
*
*
* @return A list of any errors returned while describing the merge conflicts for each file.
*/
public java.util.List getErrors() {
return errors;
}
/**
*
* A list of any errors returned while describing the merge conflicts for each file.
*
*
* @param errors
* A list of any errors returned while describing the merge conflicts for each file.
*/
public void setErrors(java.util.Collection errors) {
if (errors == null) {
this.errors = null;
return;
}
this.errors = new java.util.ArrayList(errors);
}
/**
*
* A list of any errors returned while describing the merge conflicts for each file.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setErrors(java.util.Collection)} or {@link #withErrors(java.util.Collection)} if you want to override the
* existing values.
*
*
* @param errors
* A list of any errors returned while describing the merge conflicts for each file.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BatchDescribeMergeConflictsResult withErrors(BatchDescribeMergeConflictsError... errors) {
if (this.errors == null) {
setErrors(new java.util.ArrayList(errors.length));
}
for (BatchDescribeMergeConflictsError ele : errors) {
this.errors.add(ele);
}
return this;
}
/**
*
* A list of any errors returned while describing the merge conflicts for each file.
*
*
* @param errors
* A list of any errors returned while describing the merge conflicts for each file.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BatchDescribeMergeConflictsResult withErrors(java.util.Collection errors) {
setErrors(errors);
return this;
}
/**
*
* The commit ID of the destination commit specifier that was used in the merge evaluation.
*
*
* @param destinationCommitId
* The commit ID of the destination commit specifier that was used in the merge evaluation.
*/
public void setDestinationCommitId(String destinationCommitId) {
this.destinationCommitId = destinationCommitId;
}
/**
*
* The commit ID of the destination commit specifier that was used in the merge evaluation.
*
*
* @return The commit ID of the destination commit specifier that was used in the merge evaluation.
*/
public String getDestinationCommitId() {
return this.destinationCommitId;
}
/**
*
* The commit ID of the destination commit specifier that was used in the merge evaluation.
*
*
* @param destinationCommitId
* The commit ID of the destination commit specifier that was used in the merge evaluation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BatchDescribeMergeConflictsResult withDestinationCommitId(String destinationCommitId) {
setDestinationCommitId(destinationCommitId);
return this;
}
/**
*
* The commit ID of the source commit specifier that was used in the merge evaluation.
*
*
* @param sourceCommitId
* The commit ID of the source commit specifier that was used in the merge evaluation.
*/
public void setSourceCommitId(String sourceCommitId) {
this.sourceCommitId = sourceCommitId;
}
/**
*
* The commit ID of the source commit specifier that was used in the merge evaluation.
*
*
* @return The commit ID of the source commit specifier that was used in the merge evaluation.
*/
public String getSourceCommitId() {
return this.sourceCommitId;
}
/**
*
* The commit ID of the source commit specifier that was used in the merge evaluation.
*
*
* @param sourceCommitId
* The commit ID of the source commit specifier that was used in the merge evaluation.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BatchDescribeMergeConflictsResult withSourceCommitId(String sourceCommitId) {
setSourceCommitId(sourceCommitId);
return this;
}
/**
*
* The commit ID of the merge base.
*
*
* @param baseCommitId
* The commit ID of the merge base.
*/
public void setBaseCommitId(String baseCommitId) {
this.baseCommitId = baseCommitId;
}
/**
*
* The commit ID of the merge base.
*
*
* @return The commit ID of the merge base.
*/
public String getBaseCommitId() {
return this.baseCommitId;
}
/**
*
* The commit ID of the merge base.
*
*
* @param baseCommitId
* The commit ID of the merge base.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public BatchDescribeMergeConflictsResult withBaseCommitId(String baseCommitId) {
setBaseCommitId(baseCommitId);
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 (getConflicts() != null)
sb.append("Conflicts: ").append(getConflicts()).append(",");
if (getNextToken() != null)
sb.append("NextToken: ").append(getNextToken()).append(",");
if (getErrors() != null)
sb.append("Errors: ").append(getErrors()).append(",");
if (getDestinationCommitId() != null)
sb.append("DestinationCommitId: ").append(getDestinationCommitId()).append(",");
if (getSourceCommitId() != null)
sb.append("SourceCommitId: ").append(getSourceCommitId()).append(",");
if (getBaseCommitId() != null)
sb.append("BaseCommitId: ").append(getBaseCommitId());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof BatchDescribeMergeConflictsResult == false)
return false;
BatchDescribeMergeConflictsResult other = (BatchDescribeMergeConflictsResult) obj;
if (other.getConflicts() == null ^ this.getConflicts() == null)
return false;
if (other.getConflicts() != null && other.getConflicts().equals(this.getConflicts()) == false)
return false;
if (other.getNextToken() == null ^ this.getNextToken() == null)
return false;
if (other.getNextToken() != null && other.getNextToken().equals(this.getNextToken()) == false)
return false;
if (other.getErrors() == null ^ this.getErrors() == null)
return false;
if (other.getErrors() != null && other.getErrors().equals(this.getErrors()) == false)
return false;
if (other.getDestinationCommitId() == null ^ this.getDestinationCommitId() == null)
return false;
if (other.getDestinationCommitId() != null && other.getDestinationCommitId().equals(this.getDestinationCommitId()) == false)
return false;
if (other.getSourceCommitId() == null ^ this.getSourceCommitId() == null)
return false;
if (other.getSourceCommitId() != null && other.getSourceCommitId().equals(this.getSourceCommitId()) == false)
return false;
if (other.getBaseCommitId() == null ^ this.getBaseCommitId() == null)
return false;
if (other.getBaseCommitId() != null && other.getBaseCommitId().equals(this.getBaseCommitId()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getConflicts() == null) ? 0 : getConflicts().hashCode());
hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode());
hashCode = prime * hashCode + ((getErrors() == null) ? 0 : getErrors().hashCode());
hashCode = prime * hashCode + ((getDestinationCommitId() == null) ? 0 : getDestinationCommitId().hashCode());
hashCode = prime * hashCode + ((getSourceCommitId() == null) ? 0 : getSourceCommitId().hashCode());
hashCode = prime * hashCode + ((getBaseCommitId() == null) ? 0 : getBaseCommitId().hashCode());
return hashCode;
}
@Override
public BatchDescribeMergeConflictsResult clone() {
try {
return (BatchDescribeMergeConflictsResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}