/* * 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; /** *

* The structure that lists each document processed in an AnalyzeID operation. *

*/ public class IdentityDocument implements Serializable { /** *

* Denotes the placement of a document in the IdentityDocument list. The * first document is marked 1, the second 2 and so on. *

*

* Constraints:
* Range: 0 -
*/ private Integer documentIndex; /** *

* The structure used to record information extracted from identity * documents. Contains both normalized field and value of the extracted * text. *

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

* Individual word recognition, as returned by document detection. *

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

* Denotes the placement of a document in the IdentityDocument list. The * first document is marked 1, the second 2 and so on. *

*

* Constraints:
* Range: 0 -
* * @return

* Denotes the placement of a document in the IdentityDocument list. * The first document is marked 1, the second 2 and so on. *

*/ public Integer getDocumentIndex() { return documentIndex; } /** *

* Denotes the placement of a document in the IdentityDocument list. The * first document is marked 1, the second 2 and so on. *

*

* Constraints:
* Range: 0 -
* * @param documentIndex

* Denotes the placement of a document in the IdentityDocument * list. The first document is marked 1, the second 2 and so on. *

*/ public void setDocumentIndex(Integer documentIndex) { this.documentIndex = documentIndex; } /** *

* Denotes the placement of a document in the IdentityDocument list. The * first document is marked 1, the second 2 and so on. *

*

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

* Constraints:
* Range: 0 -
* * @param documentIndex

* Denotes the placement of a document in the IdentityDocument * list. The first document is marked 1, the second 2 and so on. *

* @return A reference to this updated object so that method calls can be * chained together. */ public IdentityDocument withDocumentIndex(Integer documentIndex) { this.documentIndex = documentIndex; return this; } /** *

* The structure used to record information extracted from identity * documents. Contains both normalized field and value of the extracted * text. *

* * @return

* The structure used to record information extracted from identity * documents. Contains both normalized field and value of the * extracted text. *

*/ public java.util.List getIdentityDocumentFields() { return identityDocumentFields; } /** *

* The structure used to record information extracted from identity * documents. Contains both normalized field and value of the extracted * text. *

* * @param identityDocumentFields

* The structure used to record information extracted from * identity documents. Contains both normalized field and value * of the extracted text. *

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

* The structure used to record information extracted from identity * documents. Contains both normalized field and value of the extracted * text. *

*

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

* The structure used to record information extracted from * identity documents. Contains both normalized field and value * of the extracted text. *

* @return A reference to this updated object so that method calls can be * chained together. */ public IdentityDocument withIdentityDocumentFields( IdentityDocumentField... identityDocumentFields) { if (getIdentityDocumentFields() == null) { this.identityDocumentFields = new java.util.ArrayList( identityDocumentFields.length); } for (IdentityDocumentField value : identityDocumentFields) { this.identityDocumentFields.add(value); } return this; } /** *

* The structure used to record information extracted from identity * documents. Contains both normalized field and value of the extracted * text. *

*

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

* The structure used to record information extracted from * identity documents. Contains both normalized field and value * of the extracted text. *

* @return A reference to this updated object so that method calls can be * chained together. */ public IdentityDocument withIdentityDocumentFields( java.util.Collection identityDocumentFields) { setIdentityDocumentFields(identityDocumentFields); return this; } /** *

* Individual word recognition, as returned by document detection. *

* * @return

* Individual word recognition, as returned by document detection. *

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

* Individual word recognition, as returned by document detection. *

* * @param blocks

* Individual word recognition, as returned by document * detection. *

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

* Individual word recognition, as returned by document detection. *

*

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

* Individual word recognition, as returned by document * detection. *

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

* Individual word recognition, as returned by document detection. *

*

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

* Individual word recognition, as returned by document * detection. *

* @return A reference to this updated object so that method calls can be * chained together. */ public IdentityDocument withBlocks(java.util.Collection blocks) { setBlocks(blocks); 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 (getDocumentIndex() != null) sb.append("DocumentIndex: " + getDocumentIndex() + ","); if (getIdentityDocumentFields() != null) sb.append("IdentityDocumentFields: " + getIdentityDocumentFields() + ","); if (getBlocks() != null) sb.append("Blocks: " + getBlocks()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getDocumentIndex() == null) ? 0 : getDocumentIndex().hashCode()); hashCode = prime * hashCode + ((getIdentityDocumentFields() == null) ? 0 : getIdentityDocumentFields() .hashCode()); hashCode = prime * hashCode + ((getBlocks() == null) ? 0 : getBlocks().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof IdentityDocument == false) return false; IdentityDocument other = (IdentityDocument) obj; if (other.getDocumentIndex() == null ^ this.getDocumentIndex() == null) return false; if (other.getDocumentIndex() != null && other.getDocumentIndex().equals(this.getDocumentIndex()) == false) return false; if (other.getIdentityDocumentFields() == null ^ this.getIdentityDocumentFields() == null) return false; if (other.getIdentityDocumentFields() != null && other.getIdentityDocumentFields().equals(this.getIdentityDocumentFields()) == false) return false; if (other.getBlocks() == null ^ this.getBlocks() == null) return false; if (other.getBlocks() != null && other.getBlocks().equals(this.getBlocks()) == false) return false; return true; } }