Class Block.Builder

    • Method Detail

      • id

        public Block.TypeStage id​(@NotNull
                                  java.lang.String id)

        A unique identifier for the block, deterministically generated as a hash of the block content.

        A unique identifier for the block, deterministically generated as a hash of the block content.

        Specified by:
        id in interface Block.IdStage
        Returns:
        Reference to this so that method calls can be chained together.
      • type

        public Block.ContentStage type​(@NotNull
                                       BlockType type)

        The type of block:

        • "text" - Regular text content
        • "heading" - Section or document headings
        • "section_heading" - Subsection headings
        • "table" - Tabular data with rows and columns
        • "figure" - Images, charts, diagrams, or logos
        • "table_head" - Table header cells
        • "table_cell" - Table body cells
        • "key_value" - Key-value pairs (e.g., form regions, key-val groups, etc)
        • "page_number" - Page number indicators
        • "barcode" - Barcodes and QR codes
        • "formula" - Mathematical formulas and equations
        • "header" - Page headers
        • "footer" - Page footers

        The type of block:

        • "text" - Regular text content
        • "heading" - Section or document headings
        • "section_heading" - Subsection headings
        • "table" - Tabular data with rows and columns
        • "figure" - Images, charts, diagrams, or logos
        • "table_head" - Table header cells
        • "table_cell" - Table body cells
        • "key_value" - Key-value pairs (e.g., form regions, key-val groups, etc)
        • "page_number" - Page number indicators
        • "barcode" - Barcodes and QR codes
        • "formula" - Mathematical formulas and equations
        • "header" - Page headers
        • "footer" - Page footers
        Specified by:
        type in interface Block.TypeStage
        Returns:
        Reference to this so that method calls can be chained together.
      • content

        public Block.DetailsStage content​(@NotNull
                                          java.lang.String content)

        The textual content of the block formatted based on the target format.

        The textual content of the block formatted based on the target format.

        Specified by:
        content in interface Block.ContentStage
        Returns:
        Reference to this so that method calls can be chained together.
      • details

        public Block.MetadataStage details​(@NotNull
                                           BlockDetails details)

        Additional details specific to the block type. The schema depends on the block type.

        Additional details specific to the block type. The schema depends on the block type.

        Specified by:
        details in interface Block.DetailsStage
        Returns:
        Reference to this so that method calls can be chained together.
      • boundingBox

        public Block._FinalStage boundingBox​(@NotNull
                                             BoundingBox boundingBox)

        A simplified bounding box for the block.

        A simplified bounding box for the block.

        Specified by:
        boundingBox in interface Block.BoundingBoxStage
        Returns:
        Reference to this so that method calls can be chained together.
      • children

        public Block._FinalStage children​(java.util.List<Block> children)

        An array of child blocks. For example, a table block may contain table cell blocks as children when cellBlocksEnabled is set to true.

        Specified by:
        children in interface Block._FinalStage
        Returns:
        Reference to this so that method calls can be chained together.
      • children

        public Block._FinalStage children​(java.util.Optional<java.util.List<Block>> children)

        An array of child blocks. For example, a table block may contain table cell blocks as children when cellBlocksEnabled is set to true.

        Specified by:
        children in interface Block._FinalStage
      • parentBlockId

        public Block._FinalStage parentBlockId​(java.lang.String parentBlockId)

        The ID of the parent block. For example, for a table cell block, this would be the ID of the parent table block. Only set if this is a child block.

        Specified by:
        parentBlockId in interface Block._FinalStage
        Returns:
        Reference to this so that method calls can be chained together.
      • parentBlockId

        public Block._FinalStage parentBlockId​(java.util.Optional<java.lang.String> parentBlockId)

        The ID of the parent block. For example, for a table cell block, this would be the ID of the parent table block. Only set if this is a child block.

        Specified by:
        parentBlockId in interface Block._FinalStage