/* * Copyright 2010-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.comprehend.model; import java.io.Serializable; public class ClassifyDocumentResult implements Serializable { /** *

* The classes used by the document being analyzed. These are used for * multi-class trained models. Individual classes are mutually exclusive and * each document is expected to have only a single class assigned to it. For * example, an animal can be a dog or a cat, but not both at the same time. *

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

* The labels used the document being analyzed. These are used for * multi-label trained models. Individual labels represent different * categories that are related in some manner and are not mutually * exclusive. For example, a movie can be just an action movie, or it can be * an action movie, a science fiction movie, and a comedy, all at the same * time. *

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

* Extraction information about the document. This field is present in the * response only if your request includes the Byte parameter. *

*/ private DocumentMetadata documentMetadata; /** *

* The document type for each page in the input document. This field is * present in the response only if your request includes the * Byte parameter. *

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

* Page-level errors that the system detected while processing the input * document. The field is empty if the system encountered no errors. *

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

* Warnings detected while processing the input document. The response * includes a warning if there is a mismatch between the input document type * and the model type associated with the endpoint that you specified. The * response can also include warnings for individual pages that have a * mismatch. *

*

* The field is empty if the system generated no warnings. *

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

* The classes used by the document being analyzed. These are used for * multi-class trained models. Individual classes are mutually exclusive and * each document is expected to have only a single class assigned to it. For * example, an animal can be a dog or a cat, but not both at the same time. *

* * @return

* The classes used by the document being analyzed. These are used * for multi-class trained models. Individual classes are mutually * exclusive and each document is expected to have only a single * class assigned to it. For example, an animal can be a dog or a * cat, but not both at the same time. *

*/ public java.util.List getClasses() { return classes; } /** *

* The classes used by the document being analyzed. These are used for * multi-class trained models. Individual classes are mutually exclusive and * each document is expected to have only a single class assigned to it. For * example, an animal can be a dog or a cat, but not both at the same time. *

* * @param classes

* The classes used by the document being analyzed. These are * used for multi-class trained models. Individual classes are * mutually exclusive and each document is expected to have only * a single class assigned to it. For example, an animal can be a * dog or a cat, but not both at the same time. *

*/ public void setClasses(java.util.Collection classes) { if (classes == null) { this.classes = null; return; } this.classes = new java.util.ArrayList(classes); } /** *

* The classes used by the document being analyzed. These are used for * multi-class trained models. Individual classes are mutually exclusive and * each document is expected to have only a single class assigned to it. For * example, an animal can be a dog or a cat, but not both at the same time. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param classes

* The classes used by the document being analyzed. These are * used for multi-class trained models. Individual classes are * mutually exclusive and each document is expected to have only * a single class assigned to it. For example, an animal can be a * dog or a cat, but not both at the same time. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ClassifyDocumentResult withClasses(DocumentClass... classes) { if (getClasses() == null) { this.classes = new java.util.ArrayList(classes.length); } for (DocumentClass value : classes) { this.classes.add(value); } return this; } /** *

* The classes used by the document being analyzed. These are used for * multi-class trained models. Individual classes are mutually exclusive and * each document is expected to have only a single class assigned to it. For * example, an animal can be a dog or a cat, but not both at the same time. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param classes

* The classes used by the document being analyzed. These are * used for multi-class trained models. Individual classes are * mutually exclusive and each document is expected to have only * a single class assigned to it. For example, an animal can be a * dog or a cat, but not both at the same time. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ClassifyDocumentResult withClasses(java.util.Collection classes) { setClasses(classes); return this; } /** *

* The labels used the document being analyzed. These are used for * multi-label trained models. Individual labels represent different * categories that are related in some manner and are not mutually * exclusive. For example, a movie can be just an action movie, or it can be * an action movie, a science fiction movie, and a comedy, all at the same * time. *

* * @return

* The labels used the document being analyzed. These are used for * multi-label trained models. Individual labels represent different * categories that are related in some manner and are not mutually * exclusive. For example, a movie can be just an action movie, or * it can be an action movie, a science fiction movie, and a comedy, * all at the same time. *

*/ public java.util.List getLabels() { return labels; } /** *

* The labels used the document being analyzed. These are used for * multi-label trained models. Individual labels represent different * categories that are related in some manner and are not mutually * exclusive. For example, a movie can be just an action movie, or it can be * an action movie, a science fiction movie, and a comedy, all at the same * time. *

* * @param labels

* The labels used the document being analyzed. These are used * for multi-label trained models. Individual labels represent * different categories that are related in some manner and are * not mutually exclusive. For example, a movie can be just an * action movie, or it can be an action movie, a science fiction * movie, and a comedy, all at the same time. *

*/ public void setLabels(java.util.Collection labels) { if (labels == null) { this.labels = null; return; } this.labels = new java.util.ArrayList(labels); } /** *

* The labels used the document being analyzed. These are used for * multi-label trained models. Individual labels represent different * categories that are related in some manner and are not mutually * exclusive. For example, a movie can be just an action movie, or it can be * an action movie, a science fiction movie, and a comedy, all at the same * time. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param labels

* The labels used the document being analyzed. These are used * for multi-label trained models. Individual labels represent * different categories that are related in some manner and are * not mutually exclusive. For example, a movie can be just an * action movie, or it can be an action movie, a science fiction * movie, and a comedy, all at the same time. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ClassifyDocumentResult withLabels(DocumentLabel... labels) { if (getLabels() == null) { this.labels = new java.util.ArrayList(labels.length); } for (DocumentLabel value : labels) { this.labels.add(value); } return this; } /** *

* The labels used the document being analyzed. These are used for * multi-label trained models. Individual labels represent different * categories that are related in some manner and are not mutually * exclusive. For example, a movie can be just an action movie, or it can be * an action movie, a science fiction movie, and a comedy, all at the same * time. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param labels

* The labels used the document being analyzed. These are used * for multi-label trained models. Individual labels represent * different categories that are related in some manner and are * not mutually exclusive. For example, a movie can be just an * action movie, or it can be an action movie, a science fiction * movie, and a comedy, all at the same time. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ClassifyDocumentResult withLabels(java.util.Collection labels) { setLabels(labels); return this; } /** *

* Extraction information about the document. This field is present in the * response only if your request includes the Byte parameter. *

* * @return

* Extraction information about the document. This field is present * in the response only if your request includes the * Byte parameter. *

*/ public DocumentMetadata getDocumentMetadata() { return documentMetadata; } /** *

* Extraction information about the document. This field is present in the * response only if your request includes the Byte parameter. *

* * @param documentMetadata

* Extraction information about the document. This field is * present in the response only if your request includes the * Byte parameter. *

*/ public void setDocumentMetadata(DocumentMetadata documentMetadata) { this.documentMetadata = documentMetadata; } /** *

* Extraction information about the document. This field is present in the * response only if your request includes the Byte parameter. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param documentMetadata

* Extraction information about the document. This field is * present in the response only if your request includes the * Byte parameter. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ClassifyDocumentResult withDocumentMetadata(DocumentMetadata documentMetadata) { this.documentMetadata = documentMetadata; return this; } /** *

* The document type for each page in the input document. This field is * present in the response only if your request includes the * Byte parameter. *

* * @return

* The document type for each page in the input document. This field * is present in the response only if your request includes the * Byte parameter. *

*/ public java.util.List getDocumentType() { return documentType; } /** *

* The document type for each page in the input document. This field is * present in the response only if your request includes the * Byte parameter. *

* * @param documentType

* The document type for each page in the input document. This * field is present in the response only if your request includes * the Byte parameter. *

*/ public void setDocumentType(java.util.Collection documentType) { if (documentType == null) { this.documentType = null; return; } this.documentType = new java.util.ArrayList(documentType); } /** *

* The document type for each page in the input document. This field is * present in the response only if your request includes the * Byte parameter. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param documentType

* The document type for each page in the input document. This * field is present in the response only if your request includes * the Byte parameter. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ClassifyDocumentResult withDocumentType(DocumentTypeListItem... documentType) { if (getDocumentType() == null) { this.documentType = new java.util.ArrayList(documentType.length); } for (DocumentTypeListItem value : documentType) { this.documentType.add(value); } return this; } /** *

* The document type for each page in the input document. This field is * present in the response only if your request includes the * Byte parameter. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param documentType

* The document type for each page in the input document. This * field is present in the response only if your request includes * the Byte parameter. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ClassifyDocumentResult withDocumentType( java.util.Collection documentType) { setDocumentType(documentType); return this; } /** *

* Page-level errors that the system detected while processing the input * document. The field is empty if the system encountered no errors. *

* * @return

* Page-level errors that the system detected while processing the * input document. The field is empty if the system encountered no * errors. *

*/ public java.util.List getErrors() { return errors; } /** *

* Page-level errors that the system detected while processing the input * document. The field is empty if the system encountered no errors. *

* * @param errors

* Page-level errors that the system detected while processing * the input document. The field is empty if the system * encountered no errors. *

*/ public void setErrors(java.util.Collection errors) { if (errors == null) { this.errors = null; return; } this.errors = new java.util.ArrayList(errors); } /** *

* Page-level errors that the system detected while processing the input * document. The field is empty if the system encountered no errors. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param errors

* Page-level errors that the system detected while processing * the input document. The field is empty if the system * encountered no errors. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ClassifyDocumentResult withErrors(ErrorsListItem... errors) { if (getErrors() == null) { this.errors = new java.util.ArrayList(errors.length); } for (ErrorsListItem value : errors) { this.errors.add(value); } return this; } /** *

* Page-level errors that the system detected while processing the input * document. The field is empty if the system encountered no errors. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param errors

* Page-level errors that the system detected while processing * the input document. The field is empty if the system * encountered no errors. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ClassifyDocumentResult withErrors(java.util.Collection errors) { setErrors(errors); return this; } /** *

* Warnings detected while processing the input document. The response * includes a warning if there is a mismatch between the input document type * and the model type associated with the endpoint that you specified. The * response can also include warnings for individual pages that have a * mismatch. *

*

* The field is empty if the system generated no warnings. *

* * @return

* Warnings detected while processing the input document. The * response includes a warning if there is a mismatch between the * input document type and the model type associated with the * endpoint that you specified. The response can also include * warnings for individual pages that have a mismatch. *

*

* The field is empty if the system generated no warnings. *

*/ public java.util.List getWarnings() { return warnings; } /** *

* Warnings detected while processing the input document. The response * includes a warning if there is a mismatch between the input document type * and the model type associated with the endpoint that you specified. The * response can also include warnings for individual pages that have a * mismatch. *

*

* The field is empty if the system generated no warnings. *

* * @param warnings

* Warnings detected while processing the input document. The * response includes a warning if there is a mismatch between the * input document type and the model type associated with the * endpoint that you specified. The response can also include * warnings for individual pages that have a mismatch. *

*

* The field is empty if the system generated no warnings. *

*/ public void setWarnings(java.util.Collection warnings) { if (warnings == null) { this.warnings = null; return; } this.warnings = new java.util.ArrayList(warnings); } /** *

* Warnings detected while processing the input document. The response * includes a warning if there is a mismatch between the input document type * and the model type associated with the endpoint that you specified. The * response can also include warnings for individual pages that have a * mismatch. *

*

* The field is empty if the system generated no warnings. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param warnings

* Warnings detected while processing the input document. The * response includes a warning if there is a mismatch between the * input document type and the model type associated with the * endpoint that you specified. The response can also include * warnings for individual pages that have a mismatch. *

*

* The field is empty if the system generated no warnings. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ClassifyDocumentResult withWarnings(WarningsListItem... warnings) { if (getWarnings() == null) { this.warnings = new java.util.ArrayList(warnings.length); } for (WarningsListItem value : warnings) { this.warnings.add(value); } return this; } /** *

* Warnings detected while processing the input document. The response * includes a warning if there is a mismatch between the input document type * and the model type associated with the endpoint that you specified. The * response can also include warnings for individual pages that have a * mismatch. *

*

* The field is empty if the system generated no warnings. *

*

* Returns a reference to this object so that method calls can be chained * together. * * @param warnings

* Warnings detected while processing the input document. The * response includes a warning if there is a mismatch between the * input document type and the model type associated with the * endpoint that you specified. The response can also include * warnings for individual pages that have a mismatch. *

*

* The field is empty if the system generated no warnings. *

* @return A reference to this updated object so that method calls can be * chained together. */ public ClassifyDocumentResult withWarnings(java.util.Collection warnings) { setWarnings(warnings); return this; } /** * Returns a string representation of this object; useful for testing and * debugging. * * @return A string representation of this object. * @see java.lang.Object#toString() */ @Override public String toString() { StringBuilder sb = new StringBuilder(); sb.append("{"); if (getClasses() != null) sb.append("Classes: " + getClasses() + ","); if (getLabels() != null) sb.append("Labels: " + getLabels() + ","); if (getDocumentMetadata() != null) sb.append("DocumentMetadata: " + getDocumentMetadata() + ","); if (getDocumentType() != null) sb.append("DocumentType: " + getDocumentType() + ","); if (getErrors() != null) sb.append("Errors: " + getErrors() + ","); if (getWarnings() != null) sb.append("Warnings: " + getWarnings()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getClasses() == null) ? 0 : getClasses().hashCode()); hashCode = prime * hashCode + ((getLabels() == null) ? 0 : getLabels().hashCode()); hashCode = prime * hashCode + ((getDocumentMetadata() == null) ? 0 : getDocumentMetadata().hashCode()); hashCode = prime * hashCode + ((getDocumentType() == null) ? 0 : getDocumentType().hashCode()); hashCode = prime * hashCode + ((getErrors() == null) ? 0 : getErrors().hashCode()); hashCode = prime * hashCode + ((getWarnings() == null) ? 0 : getWarnings().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof ClassifyDocumentResult == false) return false; ClassifyDocumentResult other = (ClassifyDocumentResult) obj; if (other.getClasses() == null ^ this.getClasses() == null) return false; if (other.getClasses() != null && other.getClasses().equals(this.getClasses()) == false) return false; if (other.getLabels() == null ^ this.getLabels() == null) return false; if (other.getLabels() != null && other.getLabels().equals(this.getLabels()) == false) return false; if (other.getDocumentMetadata() == null ^ this.getDocumentMetadata() == null) return false; if (other.getDocumentMetadata() != null && other.getDocumentMetadata().equals(this.getDocumentMetadata()) == false) return false; if (other.getDocumentType() == null ^ this.getDocumentType() == null) return false; if (other.getDocumentType() != null && other.getDocumentType().equals(this.getDocumentType()) == 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.getWarnings() == null ^ this.getWarnings() == null) return false; if (other.getWarnings() != null && other.getWarnings().equals(this.getWarnings()) == false) return false; return true; } }