/* * 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.glue.model; import java.io.Serializable; import javax.annotation.Generated; /** * * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class BatchDeleteConnectionResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable { /** *

* A list of names of the connection definitions that were successfully deleted. *

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

* A map of the names of connections that were not successfully deleted to error details. *

*/ private java.util.Map errors; /** *

* A list of names of the connection definitions that were successfully deleted. *

* * @return A list of names of the connection definitions that were successfully deleted. */ public java.util.List getSucceeded() { return succeeded; } /** *

* A list of names of the connection definitions that were successfully deleted. *

* * @param succeeded * A list of names of the connection definitions that were successfully deleted. */ public void setSucceeded(java.util.Collection succeeded) { if (succeeded == null) { this.succeeded = null; return; } this.succeeded = new java.util.ArrayList(succeeded); } /** *

* A list of names of the connection definitions that were successfully deleted. *

*

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

* * @param succeeded * A list of names of the connection definitions that were successfully deleted. * @return Returns a reference to this object so that method calls can be chained together. */ public BatchDeleteConnectionResult withSucceeded(String... succeeded) { if (this.succeeded == null) { setSucceeded(new java.util.ArrayList(succeeded.length)); } for (String ele : succeeded) { this.succeeded.add(ele); } return this; } /** *

* A list of names of the connection definitions that were successfully deleted. *

* * @param succeeded * A list of names of the connection definitions that were successfully deleted. * @return Returns a reference to this object so that method calls can be chained together. */ public BatchDeleteConnectionResult withSucceeded(java.util.Collection succeeded) { setSucceeded(succeeded); return this; } /** *

* A map of the names of connections that were not successfully deleted to error details. *

* * @return A map of the names of connections that were not successfully deleted to error details. */ public java.util.Map getErrors() { return errors; } /** *

* A map of the names of connections that were not successfully deleted to error details. *

* * @param errors * A map of the names of connections that were not successfully deleted to error details. */ public void setErrors(java.util.Map errors) { this.errors = errors; } /** *

* A map of the names of connections that were not successfully deleted to error details. *

* * @param errors * A map of the names of connections that were not successfully deleted to error details. * @return Returns a reference to this object so that method calls can be chained together. */ public BatchDeleteConnectionResult withErrors(java.util.Map errors) { setErrors(errors); return this; } /** * Add a single Errors entry * * @see BatchDeleteConnectionResult#withErrors * @returns a reference to this object so that method calls can be chained together. */ public BatchDeleteConnectionResult addErrorsEntry(String key, ErrorDetail value) { if (null == this.errors) { this.errors = new java.util.HashMap(); } if (this.errors.containsKey(key)) throw new IllegalArgumentException("Duplicated keys (" + key.toString() + ") are provided."); this.errors.put(key, value); return this; } /** * Removes all the entries added into Errors. * * @return Returns a reference to this object so that method calls can be chained together. */ public BatchDeleteConnectionResult clearErrorsEntries() { this.errors = null; 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 (getSucceeded() != null) sb.append("Succeeded: ").append(getSucceeded()).append(","); if (getErrors() != null) sb.append("Errors: ").append(getErrors()); sb.append("}"); return sb.toString(); } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof BatchDeleteConnectionResult == false) return false; BatchDeleteConnectionResult other = (BatchDeleteConnectionResult) obj; if (other.getSucceeded() == null ^ this.getSucceeded() == null) return false; if (other.getSucceeded() != null && other.getSucceeded().equals(this.getSucceeded()) == false) return false; if (other.getErrors() == null ^ this.getErrors() == null) return false; if (other.getErrors() != null && other.getErrors().equals(this.getErrors()) == false) return false; return true; } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getSucceeded() == null) ? 0 : getSucceeded().hashCode()); hashCode = prime * hashCode + ((getErrors() == null) ? 0 : getErrors().hashCode()); return hashCode; } @Override public BatchDeleteConnectionResult clone() { try { return (BatchDeleteConnectionResult) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } }