Class Block.Builder
- java.lang.Object
-
- ai.extend.types.Block.Builder
-
- All Implemented Interfaces:
Block._FinalStage,Block.BoundingBoxStage,Block.ContentStage,Block.DetailsStage,Block.IdStage,Block.MetadataStage,Block.ObjectStage,Block.TypeStage
- Enclosing class:
- Block
public static final class Block.Builder extends java.lang.Object implements Block.ObjectStage, Block.IdStage, Block.TypeStage, Block.ContentStage, Block.DetailsStage, Block.MetadataStage, Block.BoundingBoxStage, Block._FinalStage
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Block._FinalStageaddAllPolygon(java.util.List<BlockPolygonItem> polygon)An array of points defining the polygon that bounds the block.Block._FinalStageaddPolygon(BlockPolygonItem polygon)An array of points defining the polygon that bounds the block.Block._FinalStageboundingBox(BlockBoundingBox boundingBox)A simplified bounding box for the block.Blockbuild()Block.DetailsStagecontent(java.lang.String content)The textual content of the block formatted based on the target format.Block.MetadataStagedetails(BlockDetails details)Additional details specific to the block type.Block.Builderfrom(Block other)Block.TypeStageid(java.lang.String id)A unique identifier for the block, deterministically generated as a hash of the block content.Block.BoundingBoxStagemetadata(BlockMetadata metadata)Metadata about the block.Block.IdStageobject(java.lang.String object)The type of object.Block._FinalStagepolygon(java.util.List<BlockPolygonItem> polygon)An array of points defining the polygon that bounds the block.Block.ContentStagetype(BlockType type)The type of block:
-
-
-
Method Detail
-
from
public Block.Builder from(Block other)
- Specified by:
fromin interfaceBlock.ObjectStage
-
object
public Block.IdStage object(@NotNull java.lang.String object)
The type of object. In this case, it will always be
"block".The type of object. In this case, it will always be
"block".- Specified by:
objectin interfaceBlock.ObjectStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
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:
idin interfaceBlock.IdStage- Returns:
- Reference to
thisso 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"table_head"- Table header cells"table_cell"- Table body cells"figure"- Images, charts, diagrams, or logos
The type of block:
"text"- Regular text content"heading"- Section or document headings"section_heading"- Subsection headings"table"- Tabular data with rows and columns"table_head"- Table header cells"table_cell"- Table body cells"figure"- Images, charts, diagrams, or logos
- Specified by:
typein interfaceBlock.TypeStage- Returns:
- Reference to
thisso 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:
contentin interfaceBlock.ContentStage- Returns:
- Reference to
thisso 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:
detailsin interfaceBlock.DetailsStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
metadata
public Block.BoundingBoxStage metadata(@NotNull BlockMetadata metadata)
Metadata about the block.
Metadata about the block.
- Specified by:
metadatain interfaceBlock.MetadataStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
boundingBox
public Block._FinalStage boundingBox(@NotNull BlockBoundingBox boundingBox)
A simplified bounding box for the block.
A simplified bounding box for the block.
- Specified by:
boundingBoxin interfaceBlock.BoundingBoxStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
addAllPolygon
public Block._FinalStage addAllPolygon(java.util.List<BlockPolygonItem> polygon)
An array of points defining the polygon that bounds the block.
- Specified by:
addAllPolygonin interfaceBlock._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
addPolygon
public Block._FinalStage addPolygon(BlockPolygonItem polygon)
An array of points defining the polygon that bounds the block.
- Specified by:
addPolygonin interfaceBlock._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
polygon
public Block._FinalStage polygon(java.util.List<BlockPolygonItem> polygon)
An array of points defining the polygon that bounds the block.
- Specified by:
polygonin interfaceBlock._FinalStage
-
build
public Block build()
- Specified by:
buildin interfaceBlock._FinalStage
-
-