/* * 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.textract.model; import java.io.Serializable; public class GetDocumentTextDetectionResult implements Serializable { /** *

* Information about a document that Amazon Textract processed. * DocumentMetadata is returned in every page of paginated * responses from an Amazon Textract video operation. *

*/ private DocumentMetadata documentMetadata; /** *

* The current status of the text detection job. *

*

* Constraints:
* Allowed Values: IN_PROGRESS, SUCCEEDED, FAILED, PARTIAL_SUCCESS */ private String jobStatus; /** *

* If the response is truncated, Amazon Textract returns this token. You can * use this token in the subsequent request to retrieve the next set of * text-detection results. *

*

* Constraints:
* Length: 1 - 255
* Pattern: .*\S.*
*/ private String nextToken; /** *

* The results of the text-detection operation. *

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

* A list of warnings that occurred during the text-detection operation for * the document. *

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

* Returns if the detection job could not be completed. Contains explanation * for what error occured. *

*/ private String statusMessage; /** *

*/ private String detectDocumentTextModelVersion; /** *

* Information about a document that Amazon Textract processed. * DocumentMetadata is returned in every page of paginated * responses from an Amazon Textract video operation. *

* * @return

* Information about a document that Amazon Textract processed. * DocumentMetadata is returned in every page of * paginated responses from an Amazon Textract video operation. *

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

* Information about a document that Amazon Textract processed. * DocumentMetadata is returned in every page of paginated * responses from an Amazon Textract video operation. *

* * @param documentMetadata

* Information about a document that Amazon Textract processed. * DocumentMetadata is returned in every page of * paginated responses from an Amazon Textract video operation. *

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

* Information about a document that Amazon Textract processed. * DocumentMetadata is returned in every page of paginated * responses from an Amazon Textract video operation. *

*

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

* Information about a document that Amazon Textract processed. * DocumentMetadata is returned in every page of * paginated responses from an Amazon Textract video operation. *

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

* The current status of the text detection job. *

*

* Constraints:
* Allowed Values: IN_PROGRESS, SUCCEEDED, FAILED, PARTIAL_SUCCESS * * @return

* The current status of the text detection job. *

* @see JobStatus */ public String getJobStatus() { return jobStatus; } /** *

* The current status of the text detection job. *

*

* Constraints:
* Allowed Values: IN_PROGRESS, SUCCEEDED, FAILED, PARTIAL_SUCCESS * * @param jobStatus

* The current status of the text detection job. *

* @see JobStatus */ public void setJobStatus(String jobStatus) { this.jobStatus = jobStatus; } /** *

* The current status of the text detection job. *

*

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

* Constraints:
* Allowed Values: IN_PROGRESS, SUCCEEDED, FAILED, PARTIAL_SUCCESS * * @param jobStatus

* The current status of the text detection job. *

* @return A reference to this updated object so that method calls can be * chained together. * @see JobStatus */ public GetDocumentTextDetectionResult withJobStatus(String jobStatus) { this.jobStatus = jobStatus; return this; } /** *

* The current status of the text detection job. *

*

* Constraints:
* Allowed Values: IN_PROGRESS, SUCCEEDED, FAILED, PARTIAL_SUCCESS * * @param jobStatus

* The current status of the text detection job. *

* @see JobStatus */ public void setJobStatus(JobStatus jobStatus) { this.jobStatus = jobStatus.toString(); } /** *

* The current status of the text detection job. *

*

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

* Constraints:
* Allowed Values: IN_PROGRESS, SUCCEEDED, FAILED, PARTIAL_SUCCESS * * @param jobStatus

* The current status of the text detection job. *

* @return A reference to this updated object so that method calls can be * chained together. * @see JobStatus */ public GetDocumentTextDetectionResult withJobStatus(JobStatus jobStatus) { this.jobStatus = jobStatus.toString(); return this; } /** *

* If the response is truncated, Amazon Textract returns this token. You can * use this token in the subsequent request to retrieve the next set of * text-detection results. *

*

* Constraints:
* Length: 1 - 255
* Pattern: .*\S.*
* * @return

* If the response is truncated, Amazon Textract returns this token. * You can use this token in the subsequent request to retrieve the * next set of text-detection results. *

*/ public String getNextToken() { return nextToken; } /** *

* If the response is truncated, Amazon Textract returns this token. You can * use this token in the subsequent request to retrieve the next set of * text-detection results. *

*

* Constraints:
* Length: 1 - 255
* Pattern: .*\S.*
* * @param nextToken

* If the response is truncated, Amazon Textract returns this * token. You can use this token in the subsequent request to * retrieve the next set of text-detection results. *

*/ public void setNextToken(String nextToken) { this.nextToken = nextToken; } /** *

* If the response is truncated, Amazon Textract returns this token. You can * use this token in the subsequent request to retrieve the next set of * text-detection results. *

*

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

* Constraints:
* Length: 1 - 255
* Pattern: .*\S.*
* * @param nextToken

* If the response is truncated, Amazon Textract returns this * token. You can use this token in the subsequent request to * retrieve the next set of text-detection results. *

* @return A reference to this updated object so that method calls can be * chained together. */ public GetDocumentTextDetectionResult withNextToken(String nextToken) { this.nextToken = nextToken; return this; } /** *

* The results of the text-detection operation. *

* * @return

* The results of the text-detection operation. *

*/ public java.util.List getBlocks() { return blocks; } /** *

* The results of the text-detection operation. *

* * @param blocks

* The results of the text-detection operation. *

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

* The results of the text-detection operation. *

*

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

* The results of the text-detection operation. *

* @return A reference to this updated object so that method calls can be * chained together. */ public GetDocumentTextDetectionResult withBlocks(Block... blocks) { if (getBlocks() == null) { this.blocks = new java.util.ArrayList(blocks.length); } for (Block value : blocks) { this.blocks.add(value); } return this; } /** *

* The results of the text-detection operation. *

*

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

* The results of the text-detection operation. *

* @return A reference to this updated object so that method calls can be * chained together. */ public GetDocumentTextDetectionResult withBlocks(java.util.Collection blocks) { setBlocks(blocks); return this; } /** *

* A list of warnings that occurred during the text-detection operation for * the document. *

* * @return

* A list of warnings that occurred during the text-detection * operation for the document. *

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

* A list of warnings that occurred during the text-detection operation for * the document. *

* * @param warnings

* A list of warnings that occurred during the text-detection * operation for the document. *

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

* A list of warnings that occurred during the text-detection operation for * the document. *

*

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

* A list of warnings that occurred during the text-detection * operation for the document. *

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

* A list of warnings that occurred during the text-detection operation for * the document. *

*

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

* A list of warnings that occurred during the text-detection * operation for the document. *

* @return A reference to this updated object so that method calls can be * chained together. */ public GetDocumentTextDetectionResult withWarnings(java.util.Collection warnings) { setWarnings(warnings); return this; } /** *

* Returns if the detection job could not be completed. Contains explanation * for what error occured. *

* * @return

* Returns if the detection job could not be completed. Contains * explanation for what error occured. *

*/ public String getStatusMessage() { return statusMessage; } /** *

* Returns if the detection job could not be completed. Contains explanation * for what error occured. *

* * @param statusMessage

* Returns if the detection job could not be completed. Contains * explanation for what error occured. *

*/ public void setStatusMessage(String statusMessage) { this.statusMessage = statusMessage; } /** *

* Returns if the detection job could not be completed. Contains explanation * for what error occured. *

*

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

* Returns if the detection job could not be completed. Contains * explanation for what error occured. *

* @return A reference to this updated object so that method calls can be * chained together. */ public GetDocumentTextDetectionResult withStatusMessage(String statusMessage) { this.statusMessage = statusMessage; return this; } /** *

* * @return

*/ public String getDetectDocumentTextModelVersion() { return detectDocumentTextModelVersion; } /** *

* * @param detectDocumentTextModelVersion

*/ public void setDetectDocumentTextModelVersion(String detectDocumentTextModelVersion) { this.detectDocumentTextModelVersion = detectDocumentTextModelVersion; } /** *

*

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

* @return A reference to this updated object so that method calls can be * chained together. */ public GetDocumentTextDetectionResult withDetectDocumentTextModelVersion( String detectDocumentTextModelVersion) { this.detectDocumentTextModelVersion = detectDocumentTextModelVersion; 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 (getDocumentMetadata() != null) sb.append("DocumentMetadata: " + getDocumentMetadata() + ","); if (getJobStatus() != null) sb.append("JobStatus: " + getJobStatus() + ","); if (getNextToken() != null) sb.append("NextToken: " + getNextToken() + ","); if (getBlocks() != null) sb.append("Blocks: " + getBlocks() + ","); if (getWarnings() != null) sb.append("Warnings: " + getWarnings() + ","); if (getStatusMessage() != null) sb.append("StatusMessage: " + getStatusMessage() + ","); if (getDetectDocumentTextModelVersion() != null) sb.append("DetectDocumentTextModelVersion: " + getDetectDocumentTextModelVersion()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDocumentMetadata() == null) ? 0 : getDocumentMetadata().hashCode()); hashCode = prime * hashCode + ((getJobStatus() == null) ? 0 : getJobStatus().hashCode()); hashCode = prime * hashCode + ((getNextToken() == null) ? 0 : getNextToken().hashCode()); hashCode = prime * hashCode + ((getBlocks() == null) ? 0 : getBlocks().hashCode()); hashCode = prime * hashCode + ((getWarnings() == null) ? 0 : getWarnings().hashCode()); hashCode = prime * hashCode + ((getStatusMessage() == null) ? 0 : getStatusMessage().hashCode()); hashCode = prime * hashCode + ((getDetectDocumentTextModelVersion() == null) ? 0 : getDetectDocumentTextModelVersion().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof GetDocumentTextDetectionResult == false) return false; GetDocumentTextDetectionResult other = (GetDocumentTextDetectionResult) obj; if (other.getDocumentMetadata() == null ^ this.getDocumentMetadata() == null) return false; if (other.getDocumentMetadata() != null && other.getDocumentMetadata().equals(this.getDocumentMetadata()) == false) return false; if (other.getJobStatus() == null ^ this.getJobStatus() == null) return false; if (other.getJobStatus() != null && other.getJobStatus().equals(this.getJobStatus()) == 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.getBlocks() == null ^ this.getBlocks() == null) return false; if (other.getBlocks() != null && other.getBlocks().equals(this.getBlocks()) == false) return false; if (other.getWarnings() == null ^ this.getWarnings() == null) return false; if (other.getWarnings() != null && other.getWarnings().equals(this.getWarnings()) == false) return false; if (other.getStatusMessage() == null ^ this.getStatusMessage() == null) return false; if (other.getStatusMessage() != null && other.getStatusMessage().equals(this.getStatusMessage()) == false) return false; if (other.getDetectDocumentTextModelVersion() == null ^ this.getDetectDocumentTextModelVersion() == null) return false; if (other.getDetectDocumentTextModelVersion() != null && other.getDetectDocumentTextModelVersion().equals( this.getDetectDocumentTextModelVersion()) == false) return false; return true; } }