All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.amazonaws.services.textract.model.Block Maven / Gradle / Ivy

Go to download

The AWS Java SDK for Amazon Textract module holds the client classes that are used for communicating with Amazon Textract Service

There is a newer version: 1.12.780
Show newest version
/*
 * Copyright 2014-2019 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;
import javax.annotation.Generated;
import com.amazonaws.protocol.StructuredPojo;
import com.amazonaws.protocol.ProtocolMarshaller;

/**
 * 

* 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 depends on the type of operation. In document-text detection (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. *

* * @see AWS API * Documentation */ @Generated("com.amazonaws:aws-java-sdk-code-generator") public class Block implements Serializable, Cloneable, StructuredPojo { /** *

* The type of text that's recognized in a block. In text-detection operations, 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's 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 a field 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 detected on a document page. A word is one or more ISO basic Latin script characters that * aren't separated by spaces that's detected on a document page. *

    *
  • *
  • *

    * LINE - A string of tab-delimited, contiguous words that's detected on a document page. *

    *
  • *
  • *

    * TABLE - A table that's detected on a document page. A table is any grid-based information with 2 or more * rows or columns with a cell span of 1 row and 1 column each. *

    *
  • *
  • *

    * CELL - A cell within a detected table. The cell is the parent of the block that contains the text in the * cell. *

    *
  • *
  • *

    * SELECTION_ELEMENT - A selectable element such as a radio button or checkbox that's detected on a document * page. Use the value of SelectionStatus to determine the status of the selection element. *

    *
  • *
*/ private String blockType; /** *

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

*/ private Float confidence; /** *

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

*/ private String text; /** *

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

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

*/ private Integer columnIndex; /** *

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

*/ private Integer rowSpan; /** *

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

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

*/ private String id; /** *

* A list of child blocks of the current block. For example a LINE object has child blocks for each WORD block * that's part of 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. The list size can be the following: *

*
    *
  • *

    * 0 - The block has no child blocks. *

    *
  • *
  • *

    * 1 - The block has child blocks. *

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

* The type of entity. The following can be returned: *

*
    *
  • *

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

    *
  • *
  • *

    * VALUE - The field text. *

    *
  • *
*

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

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

* The selection status of a selectable element such as a radio button or checkbox. *

*/ private String selectionStatus; /** *

* The page in which a block was detected. Page is returned by asynchronous operations. Page values * greater than 1 are only returned for multi-page documents that are in PDF format. A scanned image (JPG/PNG), even * if it contains multiple document pages, is always considered to be a single-page document and the value of * Page is always 1. Synchronous operations don't return Page as every input document is * considered to be a single-page document. *

*/ private Integer page; /** *

* The type of text that's recognized in a block. In text-detection operations, 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's 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 a field 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 detected on a document page. A word is one or more ISO basic Latin script characters that * aren't separated by spaces that's detected on a document page. *

    *
  • *
  • *

    * LINE - A string of tab-delimited, contiguous words that's detected on a document page. *

    *
  • *
  • *

    * TABLE - A table that's detected on a document page. A table is any grid-based information with 2 or more * rows or columns with a cell span of 1 row and 1 column each. *

    *
  • *
  • *

    * CELL - A cell within a detected table. The cell is the parent of the block that contains the text in the * cell. *

    *
  • *
  • *

    * SELECTION_ELEMENT - A selectable element such as a radio button or checkbox that's detected on a document * page. Use the value of SelectionStatus to determine the status of the selection element. *

    *
  • *
* * @param blockType * The type of text that's recognized in a block. In text-detection operations, 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's 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 a field 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 detected on a document page. A word is one or more ISO basic Latin script characters * that aren't separated by spaces that's detected on a document page. *

    *
  • *
  • *

    * LINE - A string of tab-delimited, contiguous words that's detected on a document page. *

    *
  • *
  • *

    * TABLE - A table that's detected on a document page. A table is any grid-based information with 2 or * more rows or columns with a cell span of 1 row and 1 column each. *

    *
  • *
  • *

    * CELL - A cell within a detected table. The cell is the parent of the block that contains the text * in the cell. *

    *
  • *
  • *

    * SELECTION_ELEMENT - A selectable element such as a radio button or checkbox that's detected on a * document page. Use the value of SelectionStatus to determine the status of the selection * element. *

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

    * The type of text that's recognized in a block. In text-detection operations, 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's 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 a field 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 detected on a document page. A word is one or more ISO basic Latin script characters that * aren't separated by spaces that's detected on a document page. *

      *
    • *
    • *

      * LINE - A string of tab-delimited, contiguous words that's detected on a document page. *

      *
    • *
    • *

      * TABLE - A table that's detected on a document page. A table is any grid-based information with 2 or more * rows or columns with a cell span of 1 row and 1 column each. *

      *
    • *
    • *

      * CELL - A cell within a detected table. The cell is the parent of the block that contains the text in the * cell. *

      *
    • *
    • *

      * SELECTION_ELEMENT - A selectable element such as a radio button or checkbox that's detected on a document * page. Use the value of SelectionStatus to determine the status of the selection element. *

      *
    • *
    * * @return The type of text that's recognized in a block. In text-detection operations, 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's 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 a field 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 detected on a document page. A word is one or more ISO basic Latin script characters * that aren't separated by spaces that's detected on a document page. *

      *
    • *
    • *

      * LINE - A string of tab-delimited, contiguous words that's detected on a document page. *

      *
    • *
    • *

      * TABLE - A table that's detected on a document page. A table is any grid-based information with 2 * or more rows or columns with a cell span of 1 row and 1 column each. *

      *
    • *
    • *

      * CELL - A cell within a detected table. The cell is the parent of the block that contains the text * in the cell. *

      *
    • *
    • *

      * SELECTION_ELEMENT - A selectable element such as a radio button or checkbox that's detected on a * document page. Use the value of SelectionStatus to determine the status of the selection * element. *

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

      * The type of text that's recognized in a block. In text-detection operations, 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's 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 a field 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 detected on a document page. A word is one or more ISO basic Latin script characters that * aren't separated by spaces that's detected on a document page. *

        *
      • *
      • *

        * LINE - A string of tab-delimited, contiguous words that's detected on a document page. *

        *
      • *
      • *

        * TABLE - A table that's detected on a document page. A table is any grid-based information with 2 or more * rows or columns with a cell span of 1 row and 1 column each. *

        *
      • *
      • *

        * CELL - A cell within a detected table. The cell is the parent of the block that contains the text in the * cell. *

        *
      • *
      • *

        * SELECTION_ELEMENT - A selectable element such as a radio button or checkbox that's detected on a document * page. Use the value of SelectionStatus to determine the status of the selection element. *

        *
      • *
      * * @param blockType * The type of text that's recognized in a block. In text-detection operations, 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's 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 a field 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 detected on a document page. A word is one or more ISO basic Latin script characters * that aren't separated by spaces that's detected on a document page. *

        *
      • *
      • *

        * LINE - A string of tab-delimited, contiguous words that's detected on a document page. *

        *
      • *
      • *

        * TABLE - A table that's detected on a document page. A table is any grid-based information with 2 or * more rows or columns with a cell span of 1 row and 1 column each. *

        *
      • *
      • *

        * CELL - A cell within a detected table. The cell is the parent of the block that contains the text * in the cell. *

        *
      • *
      • *

        * SELECTION_ELEMENT - A selectable element such as a radio button or checkbox that's detected on a * document page. Use the value of SelectionStatus to determine the status of the selection * element. *

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

        * The type of text that's recognized in a block. In text-detection operations, 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's 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 a field 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 detected on a document page. A word is one or more ISO basic Latin script characters that * aren't separated by spaces that's detected on a document page. *

          *
        • *
        • *

          * LINE - A string of tab-delimited, contiguous words that's detected on a document page. *

          *
        • *
        • *

          * TABLE - A table that's detected on a document page. A table is any grid-based information with 2 or more * rows or columns with a cell span of 1 row and 1 column each. *

          *
        • *
        • *

          * CELL - A cell within a detected table. The cell is the parent of the block that contains the text in the * cell. *

          *
        • *
        • *

          * SELECTION_ELEMENT - A selectable element such as a radio button or checkbox that's detected on a document * page. Use the value of SelectionStatus to determine the status of the selection element. *

          *
        • *
        * * @param blockType * The type of text that's recognized in a block. In text-detection operations, 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's 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 a field 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 detected on a document page. A word is one or more ISO basic Latin script characters * that aren't separated by spaces that's detected on a document page. *

          *
        • *
        • *

          * LINE - A string of tab-delimited, contiguous words that's detected on a document page. *

          *
        • *
        • *

          * TABLE - A table that's detected on a document page. A table is any grid-based information with 2 or * more rows or columns with a cell span of 1 row and 1 column each. *

          *
        • *
        • *

          * CELL - A cell within a detected table. The cell is the parent of the block that contains the text * in the cell. *

          *
        • *
        • *

          * SELECTION_ELEMENT - A selectable element such as a radio button or checkbox that's detected on a * document page. Use the value of SelectionStatus to determine the status of the selection * element. *

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

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

          * * @param confidence * The confidence 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 that Amazon Textract has in the accuracy of the recognized text and the accuracy of the geometry * points around the recognized text. *

          * * @return The confidence 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 this.confidence; } /** *

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

          * * @param confidence * The confidence that Amazon Textract has in the accuracy of the recognized text and the accuracy of the * geometry points around the recognized text. * @return Returns a reference to this object so that method calls can be chained together. */ public Block withConfidence(Float confidence) { setConfidence(confidence); return this; } /** *

          * 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. *

          * * @return The word or line of text that's recognized by Amazon Textract. */ public String getText() { return this.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. * @return Returns a reference to this object so that method calls can be chained together. */ public Block withText(String text) { setText(text); 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. *

          * * @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. *

          * * @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 this.rowIndex; } /** *

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

          * * @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 Returns a reference to this object so that method calls can be chained together. */ public Block withRowIndex(Integer rowIndex) { setRowIndex(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. *

          * * @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. *

          * * @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 this.columnIndex; } /** *

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

          * * @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 Returns a reference to this object so that method calls can be chained together. */ public Block withColumnIndex(Integer columnIndex) { setColumnIndex(columnIndex); return this; } /** *

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

          * * @param rowSpan * The number of rows that a table spans. RowSpan isn't returned by * DetectDocumentText and GetDocumentTextDetection. */ public void setRowSpan(Integer rowSpan) { this.rowSpan = rowSpan; } /** *

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

          * * @return The number of rows that a table spans. RowSpan isn't returned by * DetectDocumentText and GetDocumentTextDetection. */ public Integer getRowSpan() { return this.rowSpan; } /** *

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

          * * @param rowSpan * The number of rows that a table spans. RowSpan isn't returned by * DetectDocumentText and GetDocumentTextDetection. * @return Returns a reference to this object so that method calls can be chained together. */ public Block withRowSpan(Integer rowSpan) { setRowSpan(rowSpan); return this; } /** *

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

          * * @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. *

          * * @return The number of columns that a table cell spans. ColumnSpan isn't returned by * DetectDocumentText and GetDocumentTextDetection. */ public Integer getColumnSpan() { return this.columnSpan; } /** *

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

          * * @param columnSpan * The number of columns that a table cell spans. ColumnSpan isn't returned by * DetectDocumentText and GetDocumentTextDetection. * @return Returns a reference to this object so that method calls can be chained together. */ public Block withColumnSpan(Integer columnSpan) { setColumnSpan(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. *

          * * @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. *

          * * @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 this.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. * @return Returns a reference to this object so that method calls can be chained together. */ public Block withGeometry(Geometry geometry) { setGeometry(geometry); return this; } /** *

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

          * * @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. *

          * * @return The identifier for the recognized text. The identifier is only unique for a single operation. */ public String getId() { return this.id; } /** *

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

          * * @param id * The identifier for the recognized text. The identifier is only unique for a single operation. * @return Returns a reference to this object so that method calls can be chained together. */ public Block withId(String id) { setId(id); return this; } /** *

          * A list of child blocks of the current block. For example a LINE object has child blocks for each WORD block * that's part of 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. The list size can be the following: *

          *
            *
          • *

            * 0 - The block has no child blocks. *

            *
          • *
          • *

            * 1 - The block has child blocks. *

            *
          • *
          * * @return A list of child blocks of the current block. For example a LINE object has child blocks for each WORD * block that's part of 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. The list size can be the * following:

          *
            *
          • *

            * 0 - The block has no child blocks. *

            *
          • *
          • *

            * 1 - The block has child blocks. *

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

            * A list of child blocks of the current block. For example a LINE object has child blocks for each WORD block * that's part of 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. The list size can be the following: *

            *
              *
            • *

              * 0 - The block has no child blocks. *

              *
            • *
            • *

              * 1 - The block has child blocks. *

              *
            • *
            * * @param relationships * A list of child blocks of the current block. For example a LINE object has child blocks for each WORD * block that's part of 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. The list size can be the * following:

            *
              *
            • *

              * 0 - The block has no child blocks. *

              *
            • *
            • *

              * 1 - The block has 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 child blocks of the current block. For example a LINE object has child blocks for each WORD block * that's part of 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. The list size can be the following: *

              *
                *
              • *

                * 0 - The block has no child blocks. *

                *
              • *
              • *

                * 1 - The block has child blocks. *

                *
              • *
              *

              * NOTE: This method appends the values to the existing list (if any). Use * {@link #setRelationships(java.util.Collection)} or {@link #withRelationships(java.util.Collection)} if you want * to override the existing values. *

              * * @param relationships * A list of child blocks of the current block. For example a LINE object has child blocks for each WORD * block that's part of 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. The list size can be the * following:

              *
                *
              • *

                * 0 - The block has no child blocks. *

                *
              • *
              • *

                * 1 - The block has child blocks. *

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

                * A list of child blocks of the current block. For example a LINE object has child blocks for each WORD block * that's part of 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. The list size can be the following: *

                *
                  *
                • *

                  * 0 - The block has no child blocks. *

                  *
                • *
                • *

                  * 1 - The block has child blocks. *

                  *
                • *
                * * @param relationships * A list of child blocks of the current block. For example a LINE object has child blocks for each WORD * block that's part of 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. The list size can be the * following:

                *
                  *
                • *

                  * 0 - The block has no child blocks. *

                  *
                • *
                • *

                  * 1 - The block has child blocks. *

                  *
                • * @return Returns a reference to this 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 can be returned: *

                  *
                    *
                  • *

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

                    *
                  • *
                  • *

                    * VALUE - The field text. *

                    *
                  • *
                  *

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

                  * * @return The type of entity. The following can be returned:

                  *
                    *
                  • *

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

                    *
                  • *
                  • *

                    * VALUE - The field text. *

                    *
                  • *
                  *

                  * EntityTypes isn't returned by DetectDocumentText and * GetDocumentTextDetection. * @see EntityType */ public java.util.List getEntityTypes() { return entityTypes; } /** *

                  * The type of entity. The following can be returned: *

                  *
                    *
                  • *

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

                    *
                  • *
                  • *

                    * VALUE - The field text. *

                    *
                  • *
                  *

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

                  * * @param entityTypes * The type of entity. The following can be returned:

                  *
                    *
                  • *

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

                    *
                  • *
                  • *

                    * VALUE - The field text. *

                    *
                  • *
                  *

                  * EntityTypes isn't returned by DetectDocumentText and * GetDocumentTextDetection. * @see EntityType */ 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 can be returned: *

                  *
                    *
                  • *

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

                    *
                  • *
                  • *

                    * VALUE - The field text. *

                    *
                  • *
                  *

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

                  *

                  * NOTE: This method appends the values to the existing list (if any). Use * {@link #setEntityTypes(java.util.Collection)} or {@link #withEntityTypes(java.util.Collection)} if you want to * override the existing values. *

                  * * @param entityTypes * The type of entity. The following can be returned:

                  *
                    *
                  • *

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

                    *
                  • *
                  • *

                    * VALUE - The field text. *

                    *
                  • *
                  *

                  * EntityTypes isn't returned by DetectDocumentText and * GetDocumentTextDetection. * @return Returns a reference to this object so that method calls can be chained together. * @see EntityType */ public Block withEntityTypes(String... entityTypes) { if (this.entityTypes == null) { setEntityTypes(new java.util.ArrayList(entityTypes.length)); } for (String ele : entityTypes) { this.entityTypes.add(ele); } return this; } /** *

                  * The type of entity. The following can be returned: *

                  *
                    *
                  • *

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

                    *
                  • *
                  • *

                    * VALUE - The field text. *

                    *
                  • *
                  *

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

                  * * @param entityTypes * The type of entity. The following can be returned:

                  *
                    *
                  • *

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

                    *
                  • *
                  • *

                    * VALUE - The field text. *

                    *
                  • *
                  *

                  * EntityTypes isn't returned by DetectDocumentText and * GetDocumentTextDetection. * @return Returns a reference to this object so that method calls can be chained together. * @see EntityType */ public Block withEntityTypes(java.util.Collection entityTypes) { setEntityTypes(entityTypes); return this; } /** *

                  * The type of entity. The following can be returned: *

                  *
                    *
                  • *

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

                    *
                  • *
                  • *

                    * VALUE - The field text. *

                    *
                  • *
                  *

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

                  * * @param entityTypes * The type of entity. The following can be returned:

                  *
                    *
                  • *

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

                    *
                  • *
                  • *

                    * VALUE - The field text. *

                    *
                  • *
                  *

                  * EntityTypes isn't returned by DetectDocumentText and * GetDocumentTextDetection. * @return Returns a reference to this object so that method calls can be chained together. * @see EntityType */ public Block withEntityTypes(EntityType... entityTypes) { java.util.ArrayList entityTypesCopy = new java.util.ArrayList(entityTypes.length); for (EntityType value : entityTypes) { entityTypesCopy.add(value.toString()); } if (getEntityTypes() == null) { setEntityTypes(entityTypesCopy); } else { getEntityTypes().addAll(entityTypesCopy); } return this; } /** *

                  * The selection status of a selectable element such as a radio button or checkbox. *

                  * * @param selectionStatus * The selection status of a selectable element such as a radio button or checkbox. * @see SelectionStatus */ public void setSelectionStatus(String selectionStatus) { this.selectionStatus = selectionStatus; } /** *

                  * The selection status of a selectable element such as a radio button or checkbox. *

                  * * @return The selection status of a selectable element such as a radio button or checkbox. * @see SelectionStatus */ public String getSelectionStatus() { return this.selectionStatus; } /** *

                  * The selection status of a selectable element such as a radio button or checkbox. *

                  * * @param selectionStatus * The selection status of a selectable element such as a radio button or checkbox. * @return Returns a reference to this object so that method calls can be chained together. * @see SelectionStatus */ public Block withSelectionStatus(String selectionStatus) { setSelectionStatus(selectionStatus); return this; } /** *

                  * The selection status of a selectable element such as a radio button or checkbox. *

                  * * @param selectionStatus * The selection status of a selectable element such as a radio button or checkbox. * @return Returns a reference to this object so that method calls can be chained together. * @see SelectionStatus */ public Block withSelectionStatus(SelectionStatus selectionStatus) { this.selectionStatus = selectionStatus.toString(); return this; } /** *

                  * The page in which a block was detected. Page is returned by asynchronous operations. Page values * greater than 1 are only returned for multi-page documents that are in PDF format. A scanned image (JPG/PNG), even * if it contains multiple document pages, is always considered to be a single-page document and the value of * Page is always 1. Synchronous operations don't return Page as every input document is * considered to be a single-page document. *

                  * * @param page * The page in which a block was detected. Page is returned by asynchronous operations. Page * values greater than 1 are only returned for multi-page documents that are in PDF format. A scanned image * (JPG/PNG), even if it contains multiple document pages, is always considered to be a single-page document * and the value of Page is always 1. Synchronous operations don't return Page as * every input document is considered to be a single-page document. */ public void setPage(Integer page) { this.page = page; } /** *

                  * The page in which a block was detected. Page is returned by asynchronous operations. Page values * greater than 1 are only returned for multi-page documents that are in PDF format. A scanned image (JPG/PNG), even * if it contains multiple document pages, is always considered to be a single-page document and the value of * Page is always 1. Synchronous operations don't return Page as every input document is * considered to be a single-page document. *

                  * * @return The page in which a block was detected. Page is returned by asynchronous operations. Page * values greater than 1 are only returned for multi-page documents that are in PDF format. A scanned image * (JPG/PNG), even if it contains multiple document pages, is always considered to be a single-page document * and the value of Page is always 1. Synchronous operations don't return Page as * every input document is considered to be a single-page document. */ public Integer getPage() { return this.page; } /** *

                  * The page in which a block was detected. Page is returned by asynchronous operations. Page values * greater than 1 are only returned for multi-page documents that are in PDF format. A scanned image (JPG/PNG), even * if it contains multiple document pages, is always considered to be a single-page document and the value of * Page is always 1. Synchronous operations don't return Page as every input document is * considered to be a single-page document. *

                  * * @param page * The page in which a block was detected. Page is returned by asynchronous operations. Page * values greater than 1 are only returned for multi-page documents that are in PDF format. A scanned image * (JPG/PNG), even if it contains multiple document pages, is always considered to be a single-page document * and the value of Page is always 1. Synchronous operations don't return Page as * every input document is considered to be a single-page document. * @return Returns a reference to this object so that method calls can be chained together. */ public Block withPage(Integer page) { setPage(page); return this; } /** * Returns a string representation of this object. This is useful for testing and debugging. Sensitive data will be * redacted from this string using a placeholder value. * * @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: ").append(getBlockType()).append(","); if (getConfidence() != null) sb.append("Confidence: ").append(getConfidence()).append(","); if (getText() != null) sb.append("Text: ").append(getText()).append(","); if (getRowIndex() != null) sb.append("RowIndex: ").append(getRowIndex()).append(","); if (getColumnIndex() != null) sb.append("ColumnIndex: ").append(getColumnIndex()).append(","); if (getRowSpan() != null) sb.append("RowSpan: ").append(getRowSpan()).append(","); if (getColumnSpan() != null) sb.append("ColumnSpan: ").append(getColumnSpan()).append(","); if (getGeometry() != null) sb.append("Geometry: ").append(getGeometry()).append(","); if (getId() != null) sb.append("Id: ").append(getId()).append(","); if (getRelationships() != null) sb.append("Relationships: ").append(getRelationships()).append(","); if (getEntityTypes() != null) sb.append("EntityTypes: ").append(getEntityTypes()).append(","); if (getSelectionStatus() != null) sb.append("SelectionStatus: ").append(getSelectionStatus()).append(","); if (getPage() != null) sb.append("Page: ").append(getPage()); sb.append("}"); return sb.toString(); } @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.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; return true; } @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 + ((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()); return hashCode; } @Override public Block clone() { try { return (Block) super.clone(); } catch (CloneNotSupportedException e) { throw new IllegalStateException("Got a CloneNotSupportedException from Object.clone() " + "even though we're Cloneable!", e); } } @com.amazonaws.annotation.SdkInternalApi @Override public void marshall(ProtocolMarshaller protocolMarshaller) { com.amazonaws.services.textract.model.transform.BlockMarshaller.getInstance().marshall(this, protocolMarshaller); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy