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

* If AUTOMERGE is the conflict resolution strategy, a list of inputs to use when resolving conflicts during a merge. *

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

* Files to have content replaced as part of the merge conflict resolution. *

*/ private java.util.List replaceContents; /** *

* Files to be deleted as part of the merge conflict resolution. *

*/ private java.util.List deleteFiles; /** *

* File modes that are set as part of the merge conflict resolution. *

*/ private java.util.List setFileModes; /** *

* Files to have content replaced as part of the merge conflict resolution. *

* * @return Files to have content replaced as part of the merge conflict resolution. */ public java.util.List getReplaceContents() { return replaceContents; } /** *

* Files to have content replaced as part of the merge conflict resolution. *

* * @param replaceContents * Files to have content replaced as part of the merge conflict resolution. */ public void setReplaceContents(java.util.Collection replaceContents) { if (replaceContents == null) { this.replaceContents = null; return; } this.replaceContents = new java.util.ArrayList(replaceContents); } /** *

* Files to have content replaced as part of the merge conflict resolution. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setReplaceContents(java.util.Collection)} or {@link #withReplaceContents(java.util.Collection)} if you * want to override the existing values. *

* * @param replaceContents * Files to have content replaced as part of the merge conflict resolution. * @return Returns a reference to this object so that method calls can be chained together. */ public ConflictResolution withReplaceContents(ReplaceContentEntry... replaceContents) { if (this.replaceContents == null) { setReplaceContents(new java.util.ArrayList(replaceContents.length)); } for (ReplaceContentEntry ele : replaceContents) { this.replaceContents.add(ele); } return this; } /** *

* Files to have content replaced as part of the merge conflict resolution. *

* * @param replaceContents * Files to have content replaced as part of the merge conflict resolution. * @return Returns a reference to this object so that method calls can be chained together. */ public ConflictResolution withReplaceContents(java.util.Collection replaceContents) { setReplaceContents(replaceContents); return this; } /** *

* Files to be deleted as part of the merge conflict resolution. *

* * @return Files to be deleted as part of the merge conflict resolution. */ public java.util.List getDeleteFiles() { return deleteFiles; } /** *

* Files to be deleted as part of the merge conflict resolution. *

* * @param deleteFiles * Files to be deleted as part of the merge conflict resolution. */ public void setDeleteFiles(java.util.Collection deleteFiles) { if (deleteFiles == null) { this.deleteFiles = null; return; } this.deleteFiles = new java.util.ArrayList(deleteFiles); } /** *

* Files to be deleted as part of the merge conflict resolution. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setDeleteFiles(java.util.Collection)} or {@link #withDeleteFiles(java.util.Collection)} if you want to * override the existing values. *

* * @param deleteFiles * Files to be deleted as part of the merge conflict resolution. * @return Returns a reference to this object so that method calls can be chained together. */ public ConflictResolution withDeleteFiles(DeleteFileEntry... deleteFiles) { if (this.deleteFiles == null) { setDeleteFiles(new java.util.ArrayList(deleteFiles.length)); } for (DeleteFileEntry ele : deleteFiles) { this.deleteFiles.add(ele); } return this; } /** *

* Files to be deleted as part of the merge conflict resolution. *

* * @param deleteFiles * Files to be deleted as part of the merge conflict resolution. * @return Returns a reference to this object so that method calls can be chained together. */ public ConflictResolution withDeleteFiles(java.util.Collection deleteFiles) { setDeleteFiles(deleteFiles); return this; } /** *

* File modes that are set as part of the merge conflict resolution. *

* * @return File modes that are set as part of the merge conflict resolution. */ public java.util.List getSetFileModes() { return setFileModes; } /** *

* File modes that are set as part of the merge conflict resolution. *

* * @param setFileModes * File modes that are set as part of the merge conflict resolution. */ public void setSetFileModes(java.util.Collection setFileModes) { if (setFileModes == null) { this.setFileModes = null; return; } this.setFileModes = new java.util.ArrayList(setFileModes); } /** *

* File modes that are set as part of the merge conflict resolution. *

*

* NOTE: This method appends the values to the existing list (if any). Use * {@link #setSetFileModes(java.util.Collection)} or {@link #withSetFileModes(java.util.Collection)} if you want to * override the existing values. *

* * @param setFileModes * File modes that are set as part of the merge conflict resolution. * @return Returns a reference to this object so that method calls can be chained together. */ public ConflictResolution withSetFileModes(SetFileModeEntry... setFileModes) { if (this.setFileModes == null) { setSetFileModes(new java.util.ArrayList(setFileModes.length)); } for (SetFileModeEntry ele : setFileModes) { this.setFileModes.add(ele); } return this; } /** *

* File modes that are set as part of the merge conflict resolution. *

* * @param setFileModes * File modes that are set as part of the merge conflict resolution. * @return Returns a reference to this object so that method calls can be chained together. */ public ConflictResolution withSetFileModes(java.util.Collection setFileModes) { setSetFileModes(setFileModes); 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 (getReplaceContents() != null) sb.append("ReplaceContents: ").append(getReplaceContents()).append(","); if (getDeleteFiles() != null) sb.append("DeleteFiles: ").append(getDeleteFiles()).append(","); if (getSetFileModes() != null) sb.append("SetFileModes: ").append(getSetFileModes()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ConflictResolution == false) return false; ConflictResolution other = (ConflictResolution) obj; if (other.getReplaceContents() == null ^ this.getReplaceContents() == null) return false; if (other.getReplaceContents() != null && other.getReplaceContents().equals(this.getReplaceContents()) == false) return false; if (other.getDeleteFiles() == null ^ this.getDeleteFiles() == null) return false; if (other.getDeleteFiles() != null && other.getDeleteFiles().equals(this.getDeleteFiles()) == false) return false; if (other.getSetFileModes() == null ^ this.getSetFileModes() == null) return false; if (other.getSetFileModes() != null && other.getSetFileModes().equals(this.getSetFileModes()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getReplaceContents() == null) ? 0 : getReplaceContents().hashCode()); hashCode = prime * hashCode + ((getDeleteFiles() == null) ? 0 : getDeleteFiles().hashCode()); hashCode = prime * hashCode + ((getSetFileModes() == null) ? 0 : getSetFileModes().hashCode()); return hashCode; } @Override public ConflictResolution clone() { try { return (ConflictResolution) 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.ConflictResolutionMarshaller.getInstance().marshall(this, protocolMarshaller); } }