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

* A Block represents items that are recognized in a document * within a group of pixels close to each other. The information returned in a * Block object depends on the type of operation. In text detection * for documents (for example DetectDocumentText), you get information * about the detected words and lines of text. In text analysis (for example * AnalyzeDocument), you can also get information about the fields, * tables, and selection elements that are detected in the document. *

*

* An array of Block objects is returned by both synchronous and * asynchronous operations. In synchronous operations, such as * DetectDocumentText, the array of Block objects is the * entire set of results. In asynchronous operations, such as * GetDocumentAnalysis, the array is returned over one or more responses. *

*

* For more information, see How * Amazon Textract Works. *

*/ public class Block implements Serializable { /** *

* The type of text item that's recognized. In operations for text * detection, the following types are returned: *

* *

* In text analysis operations, the following types are returned: *

* *

* Constraints:
* Allowed Values: KEY_VALUE_SET, PAGE, LINE, WORD, TABLE, CELL, * SELECTION_ELEMENT, MERGED_CELL, TITLE, QUERY, QUERY_RESULT, SIGNATURE, * TABLE_TITLE, TABLE_FOOTER */ private String blockType; /** *

* The confidence score that Amazon Textract has in the accuracy of the * recognized text and the accuracy of the geometry points around the * recognized text. *

*

* Constraints:
* Length: 0.0 - 100.0
*/ private Float confidence; /** *

* The word or line of text that's recognized by Amazon Textract. *

*/ private String text; /** *

* The kind of text that Amazon Textract has detected. Can check for * handwritten text and printed text. *

*

* Constraints:
* Allowed Values: HANDWRITING, PRINTED */ private String textType; /** *

* The row in which a table cell is located. The first row position is 1. * RowIndex isn't returned by DetectDocumentText * and GetDocumentTextDetection. *

*

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

* The column in which a table cell appears. The first column position is 1. * ColumnIndex isn't returned by * DetectDocumentText and GetDocumentTextDetection * . *

*

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

* The number of rows that a table cell spans. RowSpan isn't * returned by DetectDocumentText and * GetDocumentTextDetection. *

*

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

* The number of columns that a table cell spans. ColumnSpan * isn't returned by DetectDocumentText and * GetDocumentTextDetection. *

*

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

* The location of the recognized text on the image. It includes an * axis-aligned, coarse bounding box that surrounds the text, and a * finer-grain polygon for more accurate spatial information. *

*/ private Geometry geometry; /** *

* The identifier for the recognized text. The identifier is only unique for * a single operation. *

*

* Constraints:
* Pattern: .*\S.*
*/ private String id; /** *

* A list of relationship objects that describe how blocks are related to * each other. For example, a LINE block object contains a CHILD * relationship type with the WORD blocks that make up the line of text. * There aren't Relationship objects in the list for relationships that * don't exist, such as when the current block has no child blocks. *

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

* The type of entity. *

*

* The following entity types can be returned by FORMS analysis: *

* *

* The following entity types can be returned by TABLES analysis: *

* *

* EntityTypes isn't returned by * DetectDocumentText and GetDocumentTextDetection * . *

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

* The selection status of a selection element, such as an option button or * check box. *

*

* Constraints:
* Allowed Values: SELECTED, NOT_SELECTED */ private String selectionStatus; /** *

* The page on which a block was detected. Page is returned by * synchronous and asynchronous operations. Page values greater than 1 are * only returned for multipage documents that are in PDF or TIFF format. A * scanned image (JPEG/PNG) provided to an asynchronous operation, even if * it contains multiple document pages, is considered a single-page * document. This means that for scanned images the value of * Page is always 1. Synchronous operations will also return a * Page value of 1 because every input document is considered * to be a single-page document. *

*

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

*/ private Query query; /** *

* The type of text item that's recognized. In operations for text * detection, the following types are returned: *

* *

* In text analysis operations, the following types are returned: *

* *

* Constraints:
* Allowed Values: KEY_VALUE_SET, PAGE, LINE, WORD, TABLE, CELL, * SELECTION_ELEMENT, MERGED_CELL, TITLE, QUERY, QUERY_RESULT, SIGNATURE, * TABLE_TITLE, TABLE_FOOTER * * @return

* The type of text item that's recognized. In operations for text * detection, the following types are returned: *

* *

* In text analysis operations, the following types are returned: *

* * @see BlockType */ public String getBlockType() { return blockType; } /** *

* The type of text item that's recognized. In operations for text * detection, the following types are returned: *

* *

* In text analysis operations, the following types are returned: *

* *

* Constraints:
* Allowed Values: KEY_VALUE_SET, PAGE, LINE, WORD, TABLE, CELL, * SELECTION_ELEMENT, MERGED_CELL, TITLE, QUERY, QUERY_RESULT, SIGNATURE, * TABLE_TITLE, TABLE_FOOTER * * @param blockType

* The type of text item that's recognized. In operations for * text detection, the following types are returned: *

* *

* In text analysis operations, the following types are returned: *

* * @see BlockType */ public void setBlockType(String blockType) { this.blockType = blockType; } /** *

* The type of text item that's recognized. In operations for text * detection, the following types are returned: *

* *

* In text analysis operations, the following types are returned: *

* *

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

* Constraints:
* Allowed Values: KEY_VALUE_SET, PAGE, LINE, WORD, TABLE, CELL, * SELECTION_ELEMENT, MERGED_CELL, TITLE, QUERY, QUERY_RESULT, SIGNATURE, * TABLE_TITLE, TABLE_FOOTER * * @param blockType

* The type of text item that's recognized. In operations for * text detection, the following types are returned: *

* *

* In text analysis operations, the following types are returned: *

* * @return A reference to this updated object so that method calls can be * chained together. * @see BlockType */ public Block withBlockType(String blockType) { this.blockType = blockType; return this; } /** *

* The type of text item that's recognized. In operations for text * detection, the following types are returned: *

* *

* In text analysis operations, the following types are returned: *

* *

* Constraints:
* Allowed Values: KEY_VALUE_SET, PAGE, LINE, WORD, TABLE, CELL, * SELECTION_ELEMENT, MERGED_CELL, TITLE, QUERY, QUERY_RESULT, SIGNATURE, * TABLE_TITLE, TABLE_FOOTER * * @param blockType

* The type of text item that's recognized. In operations for * text detection, the following types are returned: *

* *

* In text analysis operations, the following types are returned: *

* * @see BlockType */ public void setBlockType(BlockType blockType) { this.blockType = blockType.toString(); } /** *

* The type of text item that's recognized. In operations for text * detection, the following types are returned: *

* *

* In text analysis operations, the following types are returned: *

* *

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

* Constraints:
* Allowed Values: KEY_VALUE_SET, PAGE, LINE, WORD, TABLE, CELL, * SELECTION_ELEMENT, MERGED_CELL, TITLE, QUERY, QUERY_RESULT, SIGNATURE, * TABLE_TITLE, TABLE_FOOTER * * @param blockType

* The type of text item that's recognized. In operations for * text detection, the following types are returned: *

* *

* In text analysis operations, the following types are returned: *

* * @return A reference to this updated object so that method calls can be * chained together. * @see BlockType */ public Block withBlockType(BlockType blockType) { this.blockType = blockType.toString(); return this; } /** *

* The confidence score that Amazon Textract has in the accuracy of the * recognized text and the accuracy of the geometry points around the * recognized text. *

*

* Constraints:
* Length: 0.0 - 100.0
* * @return

* The confidence score that Amazon Textract has in the accuracy of * the recognized text and the accuracy of the geometry points * around the recognized text. *

*/ public Float getConfidence() { return confidence; } /** *

* The confidence score that Amazon Textract has in the accuracy of the * recognized text and the accuracy of the geometry points around the * recognized text. *

*

* Constraints:
* Length: 0.0 - 100.0
* * @param confidence

* The confidence score that Amazon Textract has in the accuracy * of the recognized text and the accuracy of the geometry points * around the recognized text. *

*/ public void setConfidence(Float confidence) { this.confidence = confidence; } /** *

* The confidence score that Amazon Textract has in the accuracy of the * recognized text and the accuracy of the geometry points around the * recognized text. *

*

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

* Constraints:
* Length: 0.0 - 100.0
* * @param confidence

* The confidence score that Amazon Textract has in the accuracy * of the recognized text and the accuracy of the geometry points * around the recognized text. *

* @return A reference to this updated object so that method calls can be * chained together. */ public Block withConfidence(Float confidence) { this.confidence = confidence; return this; } /** *

* The word or line of text that's recognized by Amazon Textract. *

* * @return

* The word or line of text that's recognized by Amazon Textract. *

*/ public String getText() { return text; } /** *

* The word or line of text that's recognized by Amazon Textract. *

* * @param text

* The word or line of text that's recognized by Amazon Textract. *

*/ public void setText(String text) { this.text = text; } /** *

* The word or line of text that's recognized by Amazon Textract. *

*

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

* The word or line of text that's recognized by Amazon Textract. *

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

* The kind of text that Amazon Textract has detected. Can check for * handwritten text and printed text. *

*

* Constraints:
* Allowed Values: HANDWRITING, PRINTED * * @return

* The kind of text that Amazon Textract has detected. Can check for * handwritten text and printed text. *

* @see TextType */ public String getTextType() { return textType; } /** *

* The kind of text that Amazon Textract has detected. Can check for * handwritten text and printed text. *

*

* Constraints:
* Allowed Values: HANDWRITING, PRINTED * * @param textType

* The kind of text that Amazon Textract has detected. Can check * for handwritten text and printed text. *

* @see TextType */ public void setTextType(String textType) { this.textType = textType; } /** *

* The kind of text that Amazon Textract has detected. Can check for * handwritten text and printed text. *

*

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

* Constraints:
* Allowed Values: HANDWRITING, PRINTED * * @param textType

* The kind of text that Amazon Textract has detected. Can check * for handwritten text and printed text. *

* @return A reference to this updated object so that method calls can be * chained together. * @see TextType */ public Block withTextType(String textType) { this.textType = textType; return this; } /** *

* The kind of text that Amazon Textract has detected. Can check for * handwritten text and printed text. *

*

* Constraints:
* Allowed Values: HANDWRITING, PRINTED * * @param textType

* The kind of text that Amazon Textract has detected. Can check * for handwritten text and printed text. *

* @see TextType */ public void setTextType(TextType textType) { this.textType = textType.toString(); } /** *

* The kind of text that Amazon Textract has detected. Can check for * handwritten text and printed text. *

*

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

* Constraints:
* Allowed Values: HANDWRITING, PRINTED * * @param textType

* The kind of text that Amazon Textract has detected. Can check * for handwritten text and printed text. *

* @return A reference to this updated object so that method calls can be * chained together. * @see TextType */ public Block withTextType(TextType textType) { this.textType = textType.toString(); return this; } /** *

* The row in which a table cell is located. The first row position is 1. * RowIndex isn't returned by DetectDocumentText * and GetDocumentTextDetection. *

*

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

* The row in which a table cell is located. The first row position * is 1. RowIndex isn't returned by * DetectDocumentText and * GetDocumentTextDetection. *

*/ public Integer getRowIndex() { return rowIndex; } /** *

* The row in which a table cell is located. The first row position is 1. * RowIndex isn't returned by DetectDocumentText * and GetDocumentTextDetection. *

*

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

* The row in which a table cell is located. The first row * position is 1. RowIndex isn't returned by * DetectDocumentText and * GetDocumentTextDetection. *

*/ public void setRowIndex(Integer rowIndex) { this.rowIndex = rowIndex; } /** *

* The row in which a table cell is located. The first row position is 1. * RowIndex isn't returned by DetectDocumentText * and GetDocumentTextDetection. *

*

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

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

* The row in which a table cell is located. The first row * position is 1. RowIndex isn't returned by * DetectDocumentText and * GetDocumentTextDetection. *

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

* The column in which a table cell appears. The first column position is 1. * ColumnIndex isn't returned by * DetectDocumentText and GetDocumentTextDetection * . *

*

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

* The column in which a table cell appears. The first column * position is 1. ColumnIndex isn't returned by * DetectDocumentText and * GetDocumentTextDetection. *

*/ public Integer getColumnIndex() { return columnIndex; } /** *

* The column in which a table cell appears. The first column position is 1. * ColumnIndex isn't returned by * DetectDocumentText and GetDocumentTextDetection * . *

*

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

* The column in which a table cell appears. The first column * position is 1. ColumnIndex isn't returned by * DetectDocumentText and * GetDocumentTextDetection. *

*/ public void setColumnIndex(Integer columnIndex) { this.columnIndex = columnIndex; } /** *

* The column in which a table cell appears. The first column position is 1. * ColumnIndex isn't returned by * DetectDocumentText and GetDocumentTextDetection * . *

*

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

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

* The column in which a table cell appears. The first column * position is 1. ColumnIndex isn't returned by * DetectDocumentText and * GetDocumentTextDetection. *

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

* The number of rows that a table cell spans. RowSpan isn't * returned by DetectDocumentText and * GetDocumentTextDetection. *

*

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

* The number of rows that a table cell spans. RowSpan * isn't returned by DetectDocumentText and * GetDocumentTextDetection. *

*/ public Integer getRowSpan() { return rowSpan; } /** *

* The number of rows that a table cell spans. RowSpan isn't * returned by DetectDocumentText and * GetDocumentTextDetection. *

*

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

* The number of rows that a table cell spans. * RowSpan isn't returned by * DetectDocumentText and * GetDocumentTextDetection. *

*/ public void setRowSpan(Integer rowSpan) { this.rowSpan = rowSpan; } /** *

* The number of rows that a table cell spans. RowSpan isn't * returned by DetectDocumentText and * GetDocumentTextDetection. *

*

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

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

* The number of rows that a table cell spans. * RowSpan isn't returned by * DetectDocumentText and * GetDocumentTextDetection. *

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

* The number of columns that a table cell spans. ColumnSpan * isn't returned by DetectDocumentText and * GetDocumentTextDetection. *

*

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

* The number of columns that a table cell spans. * ColumnSpan isn't returned by * DetectDocumentText and * GetDocumentTextDetection. *

*/ public Integer getColumnSpan() { return columnSpan; } /** *

* The number of columns that a table cell spans. ColumnSpan * isn't returned by DetectDocumentText and * GetDocumentTextDetection. *

*

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

* The number of columns that a table cell spans. * ColumnSpan isn't returned by * DetectDocumentText and * GetDocumentTextDetection. *

*/ public void setColumnSpan(Integer columnSpan) { this.columnSpan = columnSpan; } /** *

* The number of columns that a table cell spans. ColumnSpan * isn't returned by DetectDocumentText and * GetDocumentTextDetection. *

*

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

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

* The number of columns that a table cell spans. * ColumnSpan isn't returned by * DetectDocumentText and * GetDocumentTextDetection. *

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

* The location of the recognized text on the image. It includes an * axis-aligned, coarse bounding box that surrounds the text, and a * finer-grain polygon for more accurate spatial information. *

* * @return

* The location of the recognized text on the image. It includes an * axis-aligned, coarse bounding box that surrounds the text, and a * finer-grain polygon for more accurate spatial information. *

*/ public Geometry getGeometry() { return geometry; } /** *

* The location of the recognized text on the image. It includes an * axis-aligned, coarse bounding box that surrounds the text, and a * finer-grain polygon for more accurate spatial information. *

* * @param geometry

* The location of the recognized text on the image. It includes * an axis-aligned, coarse bounding box that surrounds the text, * and a finer-grain polygon for more accurate spatial * information. *

*/ public void setGeometry(Geometry geometry) { this.geometry = geometry; } /** *

* The location of the recognized text on the image. It includes an * axis-aligned, coarse bounding box that surrounds the text, and a * finer-grain polygon for more accurate spatial information. *

*

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

* The location of the recognized text on the image. It includes * an axis-aligned, coarse bounding box that surrounds the text, * and a finer-grain polygon for more accurate spatial * information. *

* @return A reference to this updated object so that method calls can be * chained together. */ public Block withGeometry(Geometry geometry) { this.geometry = geometry; return this; } /** *

* The identifier for the recognized text. The identifier is only unique for * a single operation. *

*

* Constraints:
* Pattern: .*\S.*
* * @return

* The identifier for the recognized text. The identifier is only * unique for a single operation. *

*/ public String getId() { return id; } /** *

* The identifier for the recognized text. The identifier is only unique for * a single operation. *

*

* Constraints:
* Pattern: .*\S.*
* * @param id

* The identifier for the recognized text. The identifier is only * unique for a single operation. *

*/ public void setId(String id) { this.id = id; } /** *

* The identifier for the recognized text. The identifier is only unique for * a single operation. *

*

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

* Constraints:
* Pattern: .*\S.*
* * @param id

* The identifier for the recognized text. The identifier is only * unique for a single operation. *

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

* A list of relationship objects that describe how blocks are related to * each other. For example, a LINE block object contains a CHILD * relationship type with the WORD blocks that make up the line of text. * There aren't Relationship objects in the list for relationships that * don't exist, such as when the current block has no child blocks. *

* * @return

* A list of relationship objects that describe how blocks are * related to each other. For example, a LINE block object contains * a CHILD relationship type with the WORD blocks that make up the * line of text. There aren't Relationship objects in the list for * relationships that don't exist, such as when the current block * has no child blocks. *

*/ public java.util.List getRelationships() { return relationships; } /** *

* A list of relationship objects that describe how blocks are related to * each other. For example, a LINE block object contains a CHILD * relationship type with the WORD blocks that make up the line of text. * There aren't Relationship objects in the list for relationships that * don't exist, such as when the current block has no child blocks. *

* * @param relationships

* A list of relationship objects that describe how blocks are * related to each other. For example, a LINE block object * contains a CHILD relationship type with the WORD blocks that * make up the line of text. There aren't Relationship objects in * the list for relationships that don't exist, such as when the * current block has no child blocks. *

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

* A list of relationship objects that describe how blocks are related to * each other. For example, a LINE block object contains a CHILD * relationship type with the WORD blocks that make up the line of text. * There aren't Relationship objects in the list for relationships that * don't exist, such as when the current block has no child blocks. *

*

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

* A list of relationship objects that describe how blocks are * related to each other. For example, a LINE block object * contains a CHILD relationship type with the WORD blocks that * make up the line of text. There aren't Relationship objects in * the list for relationships that don't exist, such as when the * current block has no child blocks. *

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

* A list of relationship objects that describe how blocks are related to * each other. For example, a LINE block object contains a CHILD * relationship type with the WORD blocks that make up the line of text. * There aren't Relationship objects in the list for relationships that * don't exist, such as when the current block has no child blocks. *

*

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

* A list of relationship objects that describe how blocks are * related to each other. For example, a LINE block object * contains a CHILD relationship type with the WORD blocks that * make up the line of text. There aren't Relationship objects in * the list for relationships that don't exist, such as when the * current block has no child blocks. *

* @return A reference to this updated object so that method calls can be * chained together. */ public Block withRelationships(java.util.Collection relationships) { setRelationships(relationships); return this; } /** *

* The type of entity. *

*

* The following entity types can be returned by FORMS analysis: *

*
    *
  • *

    * KEY - An identifier for a field on the document. *

    *
  • *
  • *

    * VALUE - The field text. *

    *
  • *
*

* The following entity types can be returned by TABLES analysis: *

*
    *
  • *

    * COLUMN_HEADER - Identifies a cell that is a header of a column. *

    *
  • *
  • *

    * TABLE_TITLE - Identifies a cell that is a title within the table. *

    *
  • *
  • *

    * TABLE_SECTION_TITLE - Identifies a cell that is a title of a * section within a table. A section title is a cell that typically spans an * entire row above a section. *

    *
  • *
  • *

    * TABLE_FOOTER - Identifies a cell that is a footer of a table. *

    *
  • *
  • *

    * TABLE_SUMMARY - Identifies a summary cell of a table. A summary * cell can be a row of a table or an additional, smaller table that * contains summary information for another table. *

    *
  • *
  • *

    * STRUCTURED_TABLE - Identifies a table with column headers where * the content of each row corresponds to the headers. *

    *
  • *
  • *

    * SEMI_STRUCTURED_TABLE - Identifies a non-structured table. *

    *
  • *
*

* EntityTypes isn't returned by * DetectDocumentText and GetDocumentTextDetection * . *

* * @return

* The type of entity. *

*

* The following entity types can be returned by FORMS analysis: *

*
    *
  • *

    * KEY - An identifier for a field on the document. *

    *
  • *
  • *

    * VALUE - The field text. *

    *
  • *
*

* The following entity types can be returned by TABLES analysis: *

*
    *
  • *

    * COLUMN_HEADER - Identifies a cell that is a header of a * column. *

    *
  • *
  • *

    * TABLE_TITLE - Identifies a cell that is a title within the * table. *

    *
  • *
  • *

    * TABLE_SECTION_TITLE - Identifies a cell that is a title of * a section within a table. A section title is a cell that * typically spans an entire row above a section. *

    *
  • *
  • *

    * TABLE_FOOTER - Identifies a cell that is a footer of a * table. *

    *
  • *
  • *

    * TABLE_SUMMARY - Identifies a summary cell of a table. A * summary cell can be a row of a table or an additional, smaller * table that contains summary information for another table. *

    *
  • *
  • *

    * STRUCTURED_TABLE - Identifies a table with column headers * where the content of each row corresponds to the headers. *

    *
  • *
  • *

    * SEMI_STRUCTURED_TABLE - Identifies a non-structured table. *

    *
  • *
*

* EntityTypes isn't returned by * DetectDocumentText and * GetDocumentTextDetection. *

*/ public java.util.List getEntityTypes() { return entityTypes; } /** *

* The type of entity. *

*

* The following entity types can be returned by FORMS analysis: *

*
    *
  • *

    * KEY - An identifier for a field on the document. *

    *
  • *
  • *

    * VALUE - The field text. *

    *
  • *
*

* The following entity types can be returned by TABLES analysis: *

*
    *
  • *

    * COLUMN_HEADER - Identifies a cell that is a header of a column. *

    *
  • *
  • *

    * TABLE_TITLE - Identifies a cell that is a title within the table. *

    *
  • *
  • *

    * TABLE_SECTION_TITLE - Identifies a cell that is a title of a * section within a table. A section title is a cell that typically spans an * entire row above a section. *

    *
  • *
  • *

    * TABLE_FOOTER - Identifies a cell that is a footer of a table. *

    *
  • *
  • *

    * TABLE_SUMMARY - Identifies a summary cell of a table. A summary * cell can be a row of a table or an additional, smaller table that * contains summary information for another table. *

    *
  • *
  • *

    * STRUCTURED_TABLE - Identifies a table with column headers where * the content of each row corresponds to the headers. *

    *
  • *
  • *

    * SEMI_STRUCTURED_TABLE - Identifies a non-structured table. *

    *
  • *
*

* EntityTypes isn't returned by * DetectDocumentText and GetDocumentTextDetection * . *

* * @param entityTypes

* The type of entity. *

*

* The following entity types can be returned by FORMS analysis: *

*
    *
  • *

    * KEY - An identifier for a field on the document. *

    *
  • *
  • *

    * VALUE - The field text. *

    *
  • *
*

* The following entity types can be returned by TABLES analysis: *

*
    *
  • *

    * COLUMN_HEADER - Identifies a cell that is a header of a * column. *

    *
  • *
  • *

    * TABLE_TITLE - Identifies a cell that is a title within * the table. *

    *
  • *
  • *

    * TABLE_SECTION_TITLE - Identifies a cell that is a title * of a section within a table. A section title is a cell that * typically spans an entire row above a section. *

    *
  • *
  • *

    * TABLE_FOOTER - Identifies a cell that is a footer of a * table. *

    *
  • *
  • *

    * TABLE_SUMMARY - Identifies a summary cell of a table. A * summary cell can be a row of a table or an additional, smaller * table that contains summary information for another table. *

    *
  • *
  • *

    * STRUCTURED_TABLE - Identifies a table with column * headers where the content of each row corresponds to the * headers. *

    *
  • *
  • *

    * SEMI_STRUCTURED_TABLE - Identifies a non-structured * table. *

    *
  • *
*

* EntityTypes isn't returned by * DetectDocumentText and * GetDocumentTextDetection. *

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

* The type of entity. *

*

* The following entity types can be returned by FORMS analysis: *

*
    *
  • *

    * KEY - An identifier for a field on the document. *

    *
  • *
  • *

    * VALUE - The field text. *

    *
  • *
*

* The following entity types can be returned by TABLES analysis: *

*
    *
  • *

    * COLUMN_HEADER - Identifies a cell that is a header of a column. *

    *
  • *
  • *

    * TABLE_TITLE - Identifies a cell that is a title within the table. *

    *
  • *
  • *

    * TABLE_SECTION_TITLE - Identifies a cell that is a title of a * section within a table. A section title is a cell that typically spans an * entire row above a section. *

    *
  • *
  • *

    * TABLE_FOOTER - Identifies a cell that is a footer of a table. *

    *
  • *
  • *

    * TABLE_SUMMARY - Identifies a summary cell of a table. A summary * cell can be a row of a table or an additional, smaller table that * contains summary information for another table. *

    *
  • *
  • *

    * STRUCTURED_TABLE - Identifies a table with column headers where * the content of each row corresponds to the headers. *

    *
  • *
  • *

    * SEMI_STRUCTURED_TABLE - Identifies a non-structured table. *

    *
  • *
*

* EntityTypes isn't returned by * DetectDocumentText and GetDocumentTextDetection * . *

*

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

* The type of entity. *

*

* The following entity types can be returned by FORMS analysis: *

*
    *
  • *

    * KEY - An identifier for a field on the document. *

    *
  • *
  • *

    * VALUE - The field text. *

    *
  • *
*

* The following entity types can be returned by TABLES analysis: *

*
    *
  • *

    * COLUMN_HEADER - Identifies a cell that is a header of a * column. *

    *
  • *
  • *

    * TABLE_TITLE - Identifies a cell that is a title within * the table. *

    *
  • *
  • *

    * TABLE_SECTION_TITLE - Identifies a cell that is a title * of a section within a table. A section title is a cell that * typically spans an entire row above a section. *

    *
  • *
  • *

    * TABLE_FOOTER - Identifies a cell that is a footer of a * table. *

    *
  • *
  • *

    * TABLE_SUMMARY - Identifies a summary cell of a table. A * summary cell can be a row of a table or an additional, smaller * table that contains summary information for another table. *

    *
  • *
  • *

    * STRUCTURED_TABLE - Identifies a table with column * headers where the content of each row corresponds to the * headers. *

    *
  • *
  • *

    * SEMI_STRUCTURED_TABLE - Identifies a non-structured * table. *

    *
  • *
*

* EntityTypes isn't returned by * DetectDocumentText and * GetDocumentTextDetection. *

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

* The type of entity. *

*

* The following entity types can be returned by FORMS analysis: *

*
    *
  • *

    * KEY - An identifier for a field on the document. *

    *
  • *
  • *

    * VALUE - The field text. *

    *
  • *
*

* The following entity types can be returned by TABLES analysis: *

*
    *
  • *

    * COLUMN_HEADER - Identifies a cell that is a header of a column. *

    *
  • *
  • *

    * TABLE_TITLE - Identifies a cell that is a title within the table. *

    *
  • *
  • *

    * TABLE_SECTION_TITLE - Identifies a cell that is a title of a * section within a table. A section title is a cell that typically spans an * entire row above a section. *

    *
  • *
  • *

    * TABLE_FOOTER - Identifies a cell that is a footer of a table. *

    *
  • *
  • *

    * TABLE_SUMMARY - Identifies a summary cell of a table. A summary * cell can be a row of a table or an additional, smaller table that * contains summary information for another table. *

    *
  • *
  • *

    * STRUCTURED_TABLE - Identifies a table with column headers where * the content of each row corresponds to the headers. *

    *
  • *
  • *

    * SEMI_STRUCTURED_TABLE - Identifies a non-structured table. *

    *
  • *
*

* EntityTypes isn't returned by * DetectDocumentText and GetDocumentTextDetection * . *

*

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

* The type of entity. *

*

* The following entity types can be returned by FORMS analysis: *

*
    *
  • *

    * KEY - An identifier for a field on the document. *

    *
  • *
  • *

    * VALUE - The field text. *

    *
  • *
*

* The following entity types can be returned by TABLES analysis: *

*
    *
  • *

    * COLUMN_HEADER - Identifies a cell that is a header of a * column. *

    *
  • *
  • *

    * TABLE_TITLE - Identifies a cell that is a title within * the table. *

    *
  • *
  • *

    * TABLE_SECTION_TITLE - Identifies a cell that is a title * of a section within a table. A section title is a cell that * typically spans an entire row above a section. *

    *
  • *
  • *

    * TABLE_FOOTER - Identifies a cell that is a footer of a * table. *

    *
  • *
  • *

    * TABLE_SUMMARY - Identifies a summary cell of a table. A * summary cell can be a row of a table or an additional, smaller * table that contains summary information for another table. *

    *
  • *
  • *

    * STRUCTURED_TABLE - Identifies a table with column * headers where the content of each row corresponds to the * headers. *

    *
  • *
  • *

    * SEMI_STRUCTURED_TABLE - Identifies a non-structured * table. *

    *
  • *
*

* EntityTypes isn't returned by * DetectDocumentText and * GetDocumentTextDetection. *

* @return A reference to this updated object so that method calls can be * chained together. */ public Block withEntityTypes(java.util.Collection entityTypes) { setEntityTypes(entityTypes); return this; } /** *

* The selection status of a selection element, such as an option button or * check box. *

*

* Constraints:
* Allowed Values: SELECTED, NOT_SELECTED * * @return

* The selection status of a selection element, such as an option * button or check box. *

* @see SelectionStatus */ public String getSelectionStatus() { return selectionStatus; } /** *

* The selection status of a selection element, such as an option button or * check box. *

*

* Constraints:
* Allowed Values: SELECTED, NOT_SELECTED * * @param selectionStatus

* The selection status of a selection element, such as an option * button or check box. *

* @see SelectionStatus */ public void setSelectionStatus(String selectionStatus) { this.selectionStatus = selectionStatus; } /** *

* The selection status of a selection element, such as an option button or * check box. *

*

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

* Constraints:
* Allowed Values: SELECTED, NOT_SELECTED * * @param selectionStatus

* The selection status of a selection element, such as an option * button or check box. *

* @return A reference to this updated object so that method calls can be * chained together. * @see SelectionStatus */ public Block withSelectionStatus(String selectionStatus) { this.selectionStatus = selectionStatus; return this; } /** *

* The selection status of a selection element, such as an option button or * check box. *

*

* Constraints:
* Allowed Values: SELECTED, NOT_SELECTED * * @param selectionStatus

* The selection status of a selection element, such as an option * button or check box. *

* @see SelectionStatus */ public void setSelectionStatus(SelectionStatus selectionStatus) { this.selectionStatus = selectionStatus.toString(); } /** *

* The selection status of a selection element, such as an option button or * check box. *

*

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

* Constraints:
* Allowed Values: SELECTED, NOT_SELECTED * * @param selectionStatus

* The selection status of a selection element, such as an option * button or check box. *

* @return A reference to this updated object so that method calls can be * chained together. * @see SelectionStatus */ public Block withSelectionStatus(SelectionStatus selectionStatus) { this.selectionStatus = selectionStatus.toString(); return this; } /** *

* The page on which a block was detected. Page is returned by * synchronous and asynchronous operations. Page values greater than 1 are * only returned for multipage documents that are in PDF or TIFF format. A * scanned image (JPEG/PNG) provided to an asynchronous operation, even if * it contains multiple document pages, is considered a single-page * document. This means that for scanned images the value of * Page is always 1. Synchronous operations will also return a * Page value of 1 because every input document is considered * to be a single-page document. *

*

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

* The page on which a block was detected. Page is * returned by synchronous and asynchronous operations. Page values * greater than 1 are only returned for multipage documents that are * in PDF or TIFF format. A scanned image (JPEG/PNG) provided to an * asynchronous operation, even if it contains multiple document * pages, is considered a single-page document. This means that for * scanned images the value of Page is always 1. * Synchronous operations will also return a Page value * of 1 because every input document is considered to be a * single-page document. *

*/ public Integer getPage() { return page; } /** *

* The page on which a block was detected. Page is returned by * synchronous and asynchronous operations. Page values greater than 1 are * only returned for multipage documents that are in PDF or TIFF format. A * scanned image (JPEG/PNG) provided to an asynchronous operation, even if * it contains multiple document pages, is considered a single-page * document. This means that for scanned images the value of * Page is always 1. Synchronous operations will also return a * Page value of 1 because every input document is considered * to be a single-page document. *

*

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

* The page on which a block was detected. Page is * returned by synchronous and asynchronous operations. Page * values greater than 1 are only returned for multipage * documents that are in PDF or TIFF format. A scanned image * (JPEG/PNG) provided to an asynchronous operation, even if it * contains multiple document pages, is considered a single-page * document. This means that for scanned images the value of * Page is always 1. Synchronous operations will * also return a Page value of 1 because every input * document is considered to be a single-page document. *

*/ public void setPage(Integer page) { this.page = page; } /** *

* The page on which a block was detected. Page is returned by * synchronous and asynchronous operations. Page values greater than 1 are * only returned for multipage documents that are in PDF or TIFF format. A * scanned image (JPEG/PNG) provided to an asynchronous operation, even if * it contains multiple document pages, is considered a single-page * document. This means that for scanned images the value of * Page is always 1. Synchronous operations will also return a * Page value of 1 because every input document is considered * to be a single-page document. *

*

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

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

* The page on which a block was detected. Page is * returned by synchronous and asynchronous operations. Page * values greater than 1 are only returned for multipage * documents that are in PDF or TIFF format. A scanned image * (JPEG/PNG) provided to an asynchronous operation, even if it * contains multiple document pages, is considered a single-page * document. This means that for scanned images the value of * Page is always 1. Synchronous operations will * also return a Page value of 1 because every input * document is considered to be a single-page document. *

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

* * @return

*/ public Query getQuery() { return query; } /** *

* * @param query

*/ public void setQuery(Query query) { this.query = query; } /** *

*

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

* @return A reference to this updated object so that method calls can be * chained together. */ public Block withQuery(Query query) { this.query = query; 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 (getBlockType() != null) sb.append("BlockType: " + getBlockType() + ","); if (getConfidence() != null) sb.append("Confidence: " + getConfidence() + ","); if (getText() != null) sb.append("Text: " + getText() + ","); if (getTextType() != null) sb.append("TextType: " + getTextType() + ","); if (getRowIndex() != null) sb.append("RowIndex: " + getRowIndex() + ","); if (getColumnIndex() != null) sb.append("ColumnIndex: " + getColumnIndex() + ","); if (getRowSpan() != null) sb.append("RowSpan: " + getRowSpan() + ","); if (getColumnSpan() != null) sb.append("ColumnSpan: " + getColumnSpan() + ","); if (getGeometry() != null) sb.append("Geometry: " + getGeometry() + ","); if (getId() != null) sb.append("Id: " + getId() + ","); if (getRelationships() != null) sb.append("Relationships: " + getRelationships() + ","); if (getEntityTypes() != null) sb.append("EntityTypes: " + getEntityTypes() + ","); if (getSelectionStatus() != null) sb.append("SelectionStatus: " + getSelectionStatus() + ","); if (getPage() != null) sb.append("Page: " + getPage() + ","); if (getQuery() != null) sb.append("Query: " + getQuery()); sb.append("}"); return sb.toString(); } @Override public int hashCode() { final int prime = 31; int hashCode = 1; hashCode = prime * hashCode + ((getBlockType() == null) ? 0 : getBlockType().hashCode()); hashCode = prime * hashCode + ((getConfidence() == null) ? 0 : getConfidence().hashCode()); hashCode = prime * hashCode + ((getText() == null) ? 0 : getText().hashCode()); hashCode = prime * hashCode + ((getTextType() == null) ? 0 : getTextType().hashCode()); hashCode = prime * hashCode + ((getRowIndex() == null) ? 0 : getRowIndex().hashCode()); hashCode = prime * hashCode + ((getColumnIndex() == null) ? 0 : getColumnIndex().hashCode()); hashCode = prime * hashCode + ((getRowSpan() == null) ? 0 : getRowSpan().hashCode()); hashCode = prime * hashCode + ((getColumnSpan() == null) ? 0 : getColumnSpan().hashCode()); hashCode = prime * hashCode + ((getGeometry() == null) ? 0 : getGeometry().hashCode()); hashCode = prime * hashCode + ((getId() == null) ? 0 : getId().hashCode()); hashCode = prime * hashCode + ((getRelationships() == null) ? 0 : getRelationships().hashCode()); hashCode = prime * hashCode + ((getEntityTypes() == null) ? 0 : getEntityTypes().hashCode()); hashCode = prime * hashCode + ((getSelectionStatus() == null) ? 0 : getSelectionStatus().hashCode()); hashCode = prime * hashCode + ((getPage() == null) ? 0 : getPage().hashCode()); hashCode = prime * hashCode + ((getQuery() == null) ? 0 : getQuery().hashCode()); return hashCode; } @Override public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (obj instanceof Block == false) return false; Block other = (Block) obj; if (other.getBlockType() == null ^ this.getBlockType() == null) return false; if (other.getBlockType() != null && other.getBlockType().equals(this.getBlockType()) == false) return false; if (other.getConfidence() == null ^ this.getConfidence() == null) return false; if (other.getConfidence() != null && other.getConfidence().equals(this.getConfidence()) == false) return false; if (other.getText() == null ^ this.getText() == null) return false; if (other.getText() != null && other.getText().equals(this.getText()) == false) return false; if (other.getTextType() == null ^ this.getTextType() == null) return false; if (other.getTextType() != null && other.getTextType().equals(this.getTextType()) == false) return false; if (other.getRowIndex() == null ^ this.getRowIndex() == null) return false; if (other.getRowIndex() != null && other.getRowIndex().equals(this.getRowIndex()) == false) return false; if (other.getColumnIndex() == null ^ this.getColumnIndex() == null) return false; if (other.getColumnIndex() != null && other.getColumnIndex().equals(this.getColumnIndex()) == false) return false; if (other.getRowSpan() == null ^ this.getRowSpan() == null) return false; if (other.getRowSpan() != null && other.getRowSpan().equals(this.getRowSpan()) == false) return false; if (other.getColumnSpan() == null ^ this.getColumnSpan() == null) return false; if (other.getColumnSpan() != null && other.getColumnSpan().equals(this.getColumnSpan()) == false) return false; if (other.getGeometry() == null ^ this.getGeometry() == null) return false; if (other.getGeometry() != null && other.getGeometry().equals(this.getGeometry()) == false) return false; if (other.getId() == null ^ this.getId() == null) return false; if (other.getId() != null && other.getId().equals(this.getId()) == false) return false; if (other.getRelationships() == null ^ this.getRelationships() == null) return false; if (other.getRelationships() != null && other.getRelationships().equals(this.getRelationships()) == false) return false; if (other.getEntityTypes() == null ^ this.getEntityTypes() == null) return false; if (other.getEntityTypes() != null && other.getEntityTypes().equals(this.getEntityTypes()) == false) return false; if (other.getSelectionStatus() == null ^ this.getSelectionStatus() == null) return false; if (other.getSelectionStatus() != null && other.getSelectionStatus().equals(this.getSelectionStatus()) == false) return false; if (other.getPage() == null ^ this.getPage() == null) return false; if (other.getPage() != null && other.getPage().equals(this.getPage()) == false) return false; if (other.getQuery() == null ^ this.getQuery() == null) return false; if (other.getQuery() != null && other.getQuery().equals(this.getQuery()) == false) return false; return true; } }