com.amazonaws.services.cloudsearchdomain.model.UploadDocumentsResult Maven / Gradle / Ivy
Show all versions of aws-java-sdk-cloudsearch Show documentation
/*
* Copyright 2016-2021 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.cloudsearchdomain.model;
import java.io.Serializable;
import javax.annotation.Generated;
/**
*
* Contains the response to an UploadDocuments
request.
*
*/
@Generated("com.amazonaws:aws-java-sdk-code-generator")
public class UploadDocumentsResult extends com.amazonaws.AmazonWebServiceResult implements Serializable, Cloneable {
/**
*
* The status of an UploadDocumentsRequest
.
*
*/
private String status;
/**
*
* The number of documents that were added to the search domain.
*
*/
private Long adds;
/**
*
* The number of documents that were deleted from the search domain.
*
*/
private Long deletes;
/**
*
* Any warnings returned by the document service about the documents being uploaded.
*
*/
private com.amazonaws.internal.SdkInternalList warnings;
/**
*
* The status of an UploadDocumentsRequest
.
*
*
* @param status
* The status of an UploadDocumentsRequest
.
*/
public void setStatus(String status) {
this.status = status;
}
/**
*
* The status of an UploadDocumentsRequest
.
*
*
* @return The status of an UploadDocumentsRequest
.
*/
public String getStatus() {
return this.status;
}
/**
*
* The status of an UploadDocumentsRequest
.
*
*
* @param status
* The status of an UploadDocumentsRequest
.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UploadDocumentsResult withStatus(String status) {
setStatus(status);
return this;
}
/**
*
* The number of documents that were added to the search domain.
*
*
* @param adds
* The number of documents that were added to the search domain.
*/
public void setAdds(Long adds) {
this.adds = adds;
}
/**
*
* The number of documents that were added to the search domain.
*
*
* @return The number of documents that were added to the search domain.
*/
public Long getAdds() {
return this.adds;
}
/**
*
* The number of documents that were added to the search domain.
*
*
* @param adds
* The number of documents that were added to the search domain.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UploadDocumentsResult withAdds(Long adds) {
setAdds(adds);
return this;
}
/**
*
* The number of documents that were deleted from the search domain.
*
*
* @param deletes
* The number of documents that were deleted from the search domain.
*/
public void setDeletes(Long deletes) {
this.deletes = deletes;
}
/**
*
* The number of documents that were deleted from the search domain.
*
*
* @return The number of documents that were deleted from the search domain.
*/
public Long getDeletes() {
return this.deletes;
}
/**
*
* The number of documents that were deleted from the search domain.
*
*
* @param deletes
* The number of documents that were deleted from the search domain.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UploadDocumentsResult withDeletes(Long deletes) {
setDeletes(deletes);
return this;
}
/**
*
* Any warnings returned by the document service about the documents being uploaded.
*
*
* @return Any warnings returned by the document service about the documents being uploaded.
*/
public java.util.List getWarnings() {
if (warnings == null) {
warnings = new com.amazonaws.internal.SdkInternalList();
}
return warnings;
}
/**
*
* Any warnings returned by the document service about the documents being uploaded.
*
*
* @param warnings
* Any warnings returned by the document service about the documents being uploaded.
*/
public void setWarnings(java.util.Collection warnings) {
if (warnings == null) {
this.warnings = null;
return;
}
this.warnings = new com.amazonaws.internal.SdkInternalList(warnings);
}
/**
*
* Any warnings returned by the document service about the documents being uploaded.
*
*
* NOTE: This method appends the values to the existing list (if any). Use
* {@link #setWarnings(java.util.Collection)} or {@link #withWarnings(java.util.Collection)} if you want to override
* the existing values.
*
*
* @param warnings
* Any warnings returned by the document service about the documents being uploaded.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UploadDocumentsResult withWarnings(DocumentServiceWarning... warnings) {
if (this.warnings == null) {
setWarnings(new com.amazonaws.internal.SdkInternalList(warnings.length));
}
for (DocumentServiceWarning ele : warnings) {
this.warnings.add(ele);
}
return this;
}
/**
*
* Any warnings returned by the document service about the documents being uploaded.
*
*
* @param warnings
* Any warnings returned by the document service about the documents being uploaded.
* @return Returns a reference to this object so that method calls can be chained together.
*/
public UploadDocumentsResult withWarnings(java.util.Collection warnings) {
setWarnings(warnings);
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 (getStatus() != null)
sb.append("Status: ").append(getStatus()).append(",");
if (getAdds() != null)
sb.append("Adds: ").append(getAdds()).append(",");
if (getDeletes() != null)
sb.append("Deletes: ").append(getDeletes()).append(",");
if (getWarnings() != null)
sb.append("Warnings: ").append(getWarnings());
sb.append("}");
return sb.toString();
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (obj instanceof UploadDocumentsResult == false)
return false;
UploadDocumentsResult other = (UploadDocumentsResult) obj;
if (other.getStatus() == null ^ this.getStatus() == null)
return false;
if (other.getStatus() != null && other.getStatus().equals(this.getStatus()) == false)
return false;
if (other.getAdds() == null ^ this.getAdds() == null)
return false;
if (other.getAdds() != null && other.getAdds().equals(this.getAdds()) == false)
return false;
if (other.getDeletes() == null ^ this.getDeletes() == null)
return false;
if (other.getDeletes() != null && other.getDeletes().equals(this.getDeletes()) == false)
return false;
if (other.getWarnings() == null ^ this.getWarnings() == null)
return false;
if (other.getWarnings() != null && other.getWarnings().equals(this.getWarnings()) == false)
return false;
return true;
}
@Override
public int hashCode() {
final int prime = 31;
int hashCode = 1;
hashCode = prime * hashCode + ((getStatus() == null) ? 0 : getStatus().hashCode());
hashCode = prime * hashCode + ((getAdds() == null) ? 0 : getAdds().hashCode());
hashCode = prime * hashCode + ((getDeletes() == null) ? 0 : getDeletes().hashCode());
hashCode = prime * hashCode + ((getWarnings() == null) ? 0 : getWarnings().hashCode());
return hashCode;
}
@Override
public UploadDocumentsResult clone() {
try {
return (UploadDocumentsResult) super.clone();
} catch (CloneNotSupportedException e) {
throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e);
}
}
}