/* * 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: *
*
* PAGE - Contains a list of the LINE Block
objects that
* are detected on a document page.
*
* WORD - A word detected on a document page. A word is one or more * ISO basic Latin script characters that aren't separated by spaces. *
** LINE - A string of tab-delimited, contiguous words that are * detected on a document page. *
** In text analysis operations, the following types are returned: *
*
* PAGE - Contains a list of child Block
objects that
* are detected on a document page.
*
* KEY_VALUE_SET - Stores the KEY and VALUE Block
* objects for linked text that's detected on a document page. Use the
* EntityType
field to determine if a KEY_VALUE_SET object is a
* KEY Block
object or a VALUE Block
object.
*
* WORD - A word that's detected on a document page. A word is one or * more ISO basic Latin script characters that aren't separated by spaces. *
** LINE - A string of tab-delimited, contiguous words that are * detected on a document page. *
** TABLE - A table that's detected on a document page. A table is * grid-based information with two or more rows or columns, with a cell span * of one row and one column each. *
** TABLE_TITLE - The title of a table. A title is typically a line of * text above or below a table, or embedded as the first row of a table. *
** TABLE_FOOTER - The footer associated with a table. A footer is * typically a line or lines of text below a table or embedded as the last * row of a table. *
** CELL - A cell within a detected table. The cell is the parent of * the block that contains the text in the cell. *
*
* MERGED_CELL - A cell in a table whose content spans more than one
* row or column. The Relationships
array for this cell contain
* data from individual cells.
*
* SELECTION_ELEMENT - A selection element such as an option button
* (radio button) or a check box that's detected on a document page. Use the
* value of SelectionStatus
to determine the status of the
* selection element.
*
* SIGNATURE - The location and confidene score of a signature * detected on a document page. Can be returned as part of a Key-Value pair * or a detected cell. *
** QUERY - A question asked during the call of AnalyzeDocument. * Contains an alias and an ID that attaches it to its answer. *
** QUERY_RESULT - A response to a question asked during the call of * analyze document. Comes with an alias and ID for ease of locating in a * response. Also contains location and confidence score. *
*
* 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* 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
* .
*
* 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;
/**
*
* The type of text item that's recognized. In operations for text * detection, the following types are returned: *
*
* PAGE - Contains a list of the LINE Block
objects that
* are detected on a document page.
*
* WORD - A word detected on a document page. A word is one or more * ISO basic Latin script characters that aren't separated by spaces. *
** LINE - A string of tab-delimited, contiguous words that are * detected on a document page. *
** In text analysis operations, the following types are returned: *
*
* PAGE - Contains a list of child Block
objects that
* are detected on a document page.
*
* KEY_VALUE_SET - Stores the KEY and VALUE Block
* objects for linked text that's detected on a document page. Use the
* EntityType
field to determine if a KEY_VALUE_SET object is a
* KEY Block
object or a VALUE Block
object.
*
* WORD - A word that's detected on a document page. A word is one or * more ISO basic Latin script characters that aren't separated by spaces. *
** LINE - A string of tab-delimited, contiguous words that are * detected on a document page. *
** TABLE - A table that's detected on a document page. A table is * grid-based information with two or more rows or columns, with a cell span * of one row and one column each. *
** TABLE_TITLE - The title of a table. A title is typically a line of * text above or below a table, or embedded as the first row of a table. *
** TABLE_FOOTER - The footer associated with a table. A footer is * typically a line or lines of text below a table or embedded as the last * row of a table. *
** CELL - A cell within a detected table. The cell is the parent of * the block that contains the text in the cell. *
*
* MERGED_CELL - A cell in a table whose content spans more than one
* row or column. The Relationships
array for this cell contain
* data from individual cells.
*
* SELECTION_ELEMENT - A selection element such as an option button
* (radio button) or a check box that's detected on a document page. Use the
* value of SelectionStatus
to determine the status of the
* selection element.
*
* SIGNATURE - The location and confidene score of a signature * detected on a document page. Can be returned as part of a Key-Value pair * or a detected cell. *
** QUERY - A question asked during the call of AnalyzeDocument. * Contains an alias and an ID that attaches it to its answer. *
** QUERY_RESULT - A response to a question asked during the call of * analyze document. Comes with an alias and ID for ease of locating in a * response. Also contains location and confidence score. *
*
* 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: *
*
* PAGE - Contains a list of the LINE Block
* objects that are detected on a document page.
*
* WORD - A word detected on a document page. A word is one * or more ISO basic Latin script characters that aren't separated * by spaces. *
** LINE - A string of tab-delimited, contiguous words that * are detected on a document page. *
** In text analysis operations, the following types are returned: *
*
* PAGE - Contains a list of child Block
objects
* that are detected on a document page.
*
* KEY_VALUE_SET - Stores the KEY and VALUE
* Block
objects for linked text that's detected on a
* document page. Use the EntityType
field to determine
* if a KEY_VALUE_SET object is a KEY Block
object or a
* VALUE Block
object.
*
* WORD - A word that's detected on a document page. A word * is one or more ISO basic Latin script characters that aren't * separated by spaces. *
** LINE - A string of tab-delimited, contiguous words that * are detected on a document page. *
** TABLE - A table that's detected on a document page. A * table is grid-based information with two or more rows or columns, * with a cell span of one row and one column each. *
** TABLE_TITLE - The title of a table. A title is typically a * line of text above or below a table, or embedded as the first row * of a table. *
** TABLE_FOOTER - The footer associated with a table. A * footer is typically a line or lines of text below a table or * embedded as the last row of a table. *
** CELL - A cell within a detected table. The cell is the * parent of the block that contains the text in the cell. *
*
* MERGED_CELL - A cell in a table whose content spans more
* than one row or column. The Relationships
array for
* this cell contain data from individual cells.
*
* SELECTION_ELEMENT - A selection element such as an option
* button (radio button) or a check box that's detected on a
* document page. Use the value of SelectionStatus
to
* determine the status of the selection element.
*
* SIGNATURE - The location and confidene score of a * signature detected on a document page. Can be returned as part of * a Key-Value pair or a detected cell. *
** QUERY - A question asked during the call of * AnalyzeDocument. Contains an alias and an ID that attaches it to * its answer. *
** QUERY_RESULT - A response to a question asked during the * call of analyze document. Comes with an alias and ID for ease of * locating in a response. Also contains location and confidence * score. *
** The type of text item that's recognized. In operations for text * detection, the following types are returned: *
*
* PAGE - Contains a list of the LINE Block
objects that
* are detected on a document page.
*
* WORD - A word detected on a document page. A word is one or more * ISO basic Latin script characters that aren't separated by spaces. *
** LINE - A string of tab-delimited, contiguous words that are * detected on a document page. *
** In text analysis operations, the following types are returned: *
*
* PAGE - Contains a list of child Block
objects that
* are detected on a document page.
*
* KEY_VALUE_SET - Stores the KEY and VALUE Block
* objects for linked text that's detected on a document page. Use the
* EntityType
field to determine if a KEY_VALUE_SET object is a
* KEY Block
object or a VALUE Block
object.
*
* WORD - A word that's detected on a document page. A word is one or * more ISO basic Latin script characters that aren't separated by spaces. *
** LINE - A string of tab-delimited, contiguous words that are * detected on a document page. *
** TABLE - A table that's detected on a document page. A table is * grid-based information with two or more rows or columns, with a cell span * of one row and one column each. *
** TABLE_TITLE - The title of a table. A title is typically a line of * text above or below a table, or embedded as the first row of a table. *
** TABLE_FOOTER - The footer associated with a table. A footer is * typically a line or lines of text below a table or embedded as the last * row of a table. *
** CELL - A cell within a detected table. The cell is the parent of * the block that contains the text in the cell. *
*
* MERGED_CELL - A cell in a table whose content spans more than one
* row or column. The Relationships
array for this cell contain
* data from individual cells.
*
* SELECTION_ELEMENT - A selection element such as an option button
* (radio button) or a check box that's detected on a document page. Use the
* value of SelectionStatus
to determine the status of the
* selection element.
*
* SIGNATURE - The location and confidene score of a signature * detected on a document page. Can be returned as part of a Key-Value pair * or a detected cell. *
** QUERY - A question asked during the call of AnalyzeDocument. * Contains an alias and an ID that attaches it to its answer. *
** QUERY_RESULT - A response to a question asked during the call of * analyze document. Comes with an alias and ID for ease of locating in a * response. Also contains location and confidence score. *
*
* 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: *
*
* PAGE - Contains a list of the LINE Block
* objects that are detected on a document page.
*
* WORD - A word detected on a document page. A word is * one or more ISO basic Latin script characters that aren't * separated by spaces. *
** LINE - A string of tab-delimited, contiguous words that * are detected on a document page. *
** In text analysis operations, the following types are returned: *
*
* PAGE - Contains a list of child Block
* objects that are detected on a document page.
*
* KEY_VALUE_SET - Stores the KEY and VALUE
* Block
objects for linked text that's detected on
* a document page. Use the EntityType
field to
* determine if a KEY_VALUE_SET object is a KEY
* Block
object or a VALUE Block
* object.
*
* WORD - A word that's detected on a document page. A * word is one or more ISO basic Latin script characters that * aren't separated by spaces. *
** LINE - A string of tab-delimited, contiguous words that * are detected on a document page. *
** TABLE - A table that's detected on a document page. A * table is grid-based information with two or more rows or * columns, with a cell span of one row and one column each. *
** TABLE_TITLE - The title of a table. A title is * typically a line of text above or below a table, or embedded * as the first row of a table. *
** TABLE_FOOTER - The footer associated with a table. A * footer is typically a line or lines of text below a table or * embedded as the last row of a table. *
** CELL - A cell within a detected table. The cell is the * parent of the block that contains the text in the cell. *
*
* MERGED_CELL - A cell in a table whose content spans
* more than one row or column. The Relationships
* array for this cell contain data from individual cells.
*
* SELECTION_ELEMENT - A selection element such as an
* option button (radio button) or a check box that's detected on
* a document page. Use the value of SelectionStatus
* to determine the status of the selection element.
*
* SIGNATURE - The location and confidene score of a * signature detected on a document page. Can be returned as part * of a Key-Value pair or a detected cell. *
** QUERY - A question asked during the call of * AnalyzeDocument. Contains an alias and an ID that attaches it * to its answer. *
** QUERY_RESULT - A response to a question asked during * the call of analyze document. Comes with an alias and ID for * ease of locating in a response. Also contains location and * confidence score. *
** The type of text item that's recognized. In operations for text * detection, the following types are returned: *
*
* PAGE - Contains a list of the LINE Block
objects that
* are detected on a document page.
*
* WORD - A word detected on a document page. A word is one or more * ISO basic Latin script characters that aren't separated by spaces. *
** LINE - A string of tab-delimited, contiguous words that are * detected on a document page. *
** In text analysis operations, the following types are returned: *
*
* PAGE - Contains a list of child Block
objects that
* are detected on a document page.
*
* KEY_VALUE_SET - Stores the KEY and VALUE Block
* objects for linked text that's detected on a document page. Use the
* EntityType
field to determine if a KEY_VALUE_SET object is a
* KEY Block
object or a VALUE Block
object.
*
* WORD - A word that's detected on a document page. A word is one or * more ISO basic Latin script characters that aren't separated by spaces. *
** LINE - A string of tab-delimited, contiguous words that are * detected on a document page. *
** TABLE - A table that's detected on a document page. A table is * grid-based information with two or more rows or columns, with a cell span * of one row and one column each. *
** TABLE_TITLE - The title of a table. A title is typically a line of * text above or below a table, or embedded as the first row of a table. *
** TABLE_FOOTER - The footer associated with a table. A footer is * typically a line or lines of text below a table or embedded as the last * row of a table. *
** CELL - A cell within a detected table. The cell is the parent of * the block that contains the text in the cell. *
*
* MERGED_CELL - A cell in a table whose content spans more than one
* row or column. The Relationships
array for this cell contain
* data from individual cells.
*
* SELECTION_ELEMENT - A selection element such as an option button
* (radio button) or a check box that's detected on a document page. Use the
* value of SelectionStatus
to determine the status of the
* selection element.
*
* SIGNATURE - The location and confidene score of a signature * detected on a document page. Can be returned as part of a Key-Value pair * or a detected cell. *
** QUERY - A question asked during the call of AnalyzeDocument. * Contains an alias and an ID that attaches it to its answer. *
** QUERY_RESULT - A response to a question asked during the call of * analyze document. Comes with an alias and ID for ease of locating in a * response. Also contains location and confidence score. *
** 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: *
*
* PAGE - Contains a list of the LINE Block
* objects that are detected on a document page.
*
* WORD - A word detected on a document page. A word is * one or more ISO basic Latin script characters that aren't * separated by spaces. *
** LINE - A string of tab-delimited, contiguous words that * are detected on a document page. *
** In text analysis operations, the following types are returned: *
*
* PAGE - Contains a list of child Block
* objects that are detected on a document page.
*
* KEY_VALUE_SET - Stores the KEY and VALUE
* Block
objects for linked text that's detected on
* a document page. Use the EntityType
field to
* determine if a KEY_VALUE_SET object is a KEY
* Block
object or a VALUE Block
* object.
*
* WORD - A word that's detected on a document page. A * word is one or more ISO basic Latin script characters that * aren't separated by spaces. *
** LINE - A string of tab-delimited, contiguous words that * are detected on a document page. *
** TABLE - A table that's detected on a document page. A * table is grid-based information with two or more rows or * columns, with a cell span of one row and one column each. *
** TABLE_TITLE - The title of a table. A title is * typically a line of text above or below a table, or embedded * as the first row of a table. *
** TABLE_FOOTER - The footer associated with a table. A * footer is typically a line or lines of text below a table or * embedded as the last row of a table. *
** CELL - A cell within a detected table. The cell is the * parent of the block that contains the text in the cell. *
*
* MERGED_CELL - A cell in a table whose content spans
* more than one row or column. The Relationships
* array for this cell contain data from individual cells.
*
* SELECTION_ELEMENT - A selection element such as an
* option button (radio button) or a check box that's detected on
* a document page. Use the value of SelectionStatus
* to determine the status of the selection element.
*
* SIGNATURE - The location and confidene score of a * signature detected on a document page. Can be returned as part * of a Key-Value pair or a detected cell. *
** QUERY - A question asked during the call of * AnalyzeDocument. Contains an alias and an ID that attaches it * to its answer. *
** QUERY_RESULT - A response to a question asked during * the call of analyze document. Comes with an alias and ID for * ease of locating in a response. Also contains location and * confidence score. *
** The type of text item that's recognized. In operations for text * detection, the following types are returned: *
*
* PAGE - Contains a list of the LINE Block
objects that
* are detected on a document page.
*
* WORD - A word detected on a document page. A word is one or more * ISO basic Latin script characters that aren't separated by spaces. *
** LINE - A string of tab-delimited, contiguous words that are * detected on a document page. *
** In text analysis operations, the following types are returned: *
*
* PAGE - Contains a list of child Block
objects that
* are detected on a document page.
*
* KEY_VALUE_SET - Stores the KEY and VALUE Block
* objects for linked text that's detected on a document page. Use the
* EntityType
field to determine if a KEY_VALUE_SET object is a
* KEY Block
object or a VALUE Block
object.
*
* WORD - A word that's detected on a document page. A word is one or * more ISO basic Latin script characters that aren't separated by spaces. *
** LINE - A string of tab-delimited, contiguous words that are * detected on a document page. *
** TABLE - A table that's detected on a document page. A table is * grid-based information with two or more rows or columns, with a cell span * of one row and one column each. *
** TABLE_TITLE - The title of a table. A title is typically a line of * text above or below a table, or embedded as the first row of a table. *
** TABLE_FOOTER - The footer associated with a table. A footer is * typically a line or lines of text below a table or embedded as the last * row of a table. *
** CELL - A cell within a detected table. The cell is the parent of * the block that contains the text in the cell. *
*
* MERGED_CELL - A cell in a table whose content spans more than one
* row or column. The Relationships
array for this cell contain
* data from individual cells.
*
* SELECTION_ELEMENT - A selection element such as an option button
* (radio button) or a check box that's detected on a document page. Use the
* value of SelectionStatus
to determine the status of the
* selection element.
*
* SIGNATURE - The location and confidene score of a signature * detected on a document page. Can be returned as part of a Key-Value pair * or a detected cell. *
** QUERY - A question asked during the call of AnalyzeDocument. * Contains an alias and an ID that attaches it to its answer. *
** QUERY_RESULT - A response to a question asked during the call of * analyze document. Comes with an alias and ID for ease of locating in a * response. Also contains location and confidence score. *
*
* 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: *
*
* PAGE - Contains a list of the LINE Block
* objects that are detected on a document page.
*
* WORD - A word detected on a document page. A word is * one or more ISO basic Latin script characters that aren't * separated by spaces. *
** LINE - A string of tab-delimited, contiguous words that * are detected on a document page. *
** In text analysis operations, the following types are returned: *
*
* PAGE - Contains a list of child Block
* objects that are detected on a document page.
*
* KEY_VALUE_SET - Stores the KEY and VALUE
* Block
objects for linked text that's detected on
* a document page. Use the EntityType
field to
* determine if a KEY_VALUE_SET object is a KEY
* Block
object or a VALUE Block
* object.
*
* WORD - A word that's detected on a document page. A * word is one or more ISO basic Latin script characters that * aren't separated by spaces. *
** LINE - A string of tab-delimited, contiguous words that * are detected on a document page. *
** TABLE - A table that's detected on a document page. A * table is grid-based information with two or more rows or * columns, with a cell span of one row and one column each. *
** TABLE_TITLE - The title of a table. A title is * typically a line of text above or below a table, or embedded * as the first row of a table. *
** TABLE_FOOTER - The footer associated with a table. A * footer is typically a line or lines of text below a table or * embedded as the last row of a table. *
** CELL - A cell within a detected table. The cell is the * parent of the block that contains the text in the cell. *
*
* MERGED_CELL - A cell in a table whose content spans
* more than one row or column. The Relationships
* array for this cell contain data from individual cells.
*
* SELECTION_ELEMENT - A selection element such as an
* option button (radio button) or a check box that's detected on
* a document page. Use the value of SelectionStatus
* to determine the status of the selection element.
*
* SIGNATURE - The location and confidene score of a * signature detected on a document page. Can be returned as part * of a Key-Value pair or a detected cell. *
** QUERY - A question asked during the call of * AnalyzeDocument. Contains an alias and an ID that attaches it * to its answer. *
** QUERY_RESULT - A response to a question asked during * the call of analyze document. Comes with an alias and ID for * ease of locating in a response. Also contains location and * confidence score. *
** The type of text item that's recognized. In operations for text * detection, the following types are returned: *
*
* PAGE - Contains a list of the LINE Block
objects that
* are detected on a document page.
*
* WORD - A word detected on a document page. A word is one or more * ISO basic Latin script characters that aren't separated by spaces. *
** LINE - A string of tab-delimited, contiguous words that are * detected on a document page. *
** In text analysis operations, the following types are returned: *
*
* PAGE - Contains a list of child Block
objects that
* are detected on a document page.
*
* KEY_VALUE_SET - Stores the KEY and VALUE Block
* objects for linked text that's detected on a document page. Use the
* EntityType
field to determine if a KEY_VALUE_SET object is a
* KEY Block
object or a VALUE Block
object.
*
* WORD - A word that's detected on a document page. A word is one or * more ISO basic Latin script characters that aren't separated by spaces. *
** LINE - A string of tab-delimited, contiguous words that are * detected on a document page. *
** TABLE - A table that's detected on a document page. A table is * grid-based information with two or more rows or columns, with a cell span * of one row and one column each. *
** TABLE_TITLE - The title of a table. A title is typically a line of * text above or below a table, or embedded as the first row of a table. *
** TABLE_FOOTER - The footer associated with a table. A footer is * typically a line or lines of text below a table or embedded as the last * row of a table. *
** CELL - A cell within a detected table. The cell is the parent of * the block that contains the text in the cell. *
*
* MERGED_CELL - A cell in a table whose content spans more than one
* row or column. The Relationships
array for this cell contain
* data from individual cells.
*
* SELECTION_ELEMENT - A selection element such as an option button
* (radio button) or a check box that's detected on a document page. Use the
* value of SelectionStatus
to determine the status of the
* selection element.
*
* SIGNATURE - The location and confidene score of a signature * detected on a document page. Can be returned as part of a Key-Value pair * or a detected cell. *
** QUERY - A question asked during the call of AnalyzeDocument. * Contains an alias and an ID that attaches it to its answer. *
** QUERY_RESULT - A response to a question asked during the call of * analyze document. Comes with an alias and ID for ease of locating in a * response. Also contains location and confidence score. *
** 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: *
*
* PAGE - Contains a list of the LINE Block
* objects that are detected on a document page.
*
* WORD - A word detected on a document page. A word is * one or more ISO basic Latin script characters that aren't * separated by spaces. *
** LINE - A string of tab-delimited, contiguous words that * are detected on a document page. *
** In text analysis operations, the following types are returned: *
*
* PAGE - Contains a list of child Block
* objects that are detected on a document page.
*
* KEY_VALUE_SET - Stores the KEY and VALUE
* Block
objects for linked text that's detected on
* a document page. Use the EntityType
field to
* determine if a KEY_VALUE_SET object is a KEY
* Block
object or a VALUE Block
* object.
*
* WORD - A word that's detected on a document page. A * word is one or more ISO basic Latin script characters that * aren't separated by spaces. *
** LINE - A string of tab-delimited, contiguous words that * are detected on a document page. *
** TABLE - A table that's detected on a document page. A * table is grid-based information with two or more rows or * columns, with a cell span of one row and one column each. *
** TABLE_TITLE - The title of a table. A title is * typically a line of text above or below a table, or embedded * as the first row of a table. *
** TABLE_FOOTER - The footer associated with a table. A * footer is typically a line or lines of text below a table or * embedded as the last row of a table. *
** CELL - A cell within a detected table. The cell is the * parent of the block that contains the text in the cell. *
*
* MERGED_CELL - A cell in a table whose content spans
* more than one row or column. The Relationships
* array for this cell contain data from individual cells.
*
* SELECTION_ELEMENT - A selection element such as an
* option button (radio button) or a check box that's detected on
* a document page. Use the value of SelectionStatus
* to determine the status of the selection element.
*
* SIGNATURE - The location and confidene score of a * signature detected on a document page. Can be returned as part * of a Key-Value pair or a detected cell. *
** QUERY - A question asked during the call of * AnalyzeDocument. Contains an alias and an ID that attaches it * to its answer. *
** QUERY_RESULT - A response to a question asked during * the call of analyze document. Comes with an alias and ID for * ease of locating in a response. Also contains location and * confidence score. *
** 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
.
*
* 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
.
*
* 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
.
*
* 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
.
*
* 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
.
*
* 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
.
*
* 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
.
*
* 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
.
*
* 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
.
*
* 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
.
*
* 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
.
*
* 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
.
*
* 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* 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* 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* 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* 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
* .
*
* 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
.
*
* 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
* .
*
* 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
.
*
* 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
.
*
* 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
.
*
* 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.
*
* 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.
*
* 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.
*
* 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; } }