Package ai.extend.types
Class Block
- java.lang.Object
-
- ai.extend.types.Block
-
public final class Block extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceBlock._FinalStagestatic interfaceBlock.BoundingBoxStagestatic classBlock.Builderstatic interfaceBlock.ContentStagestatic interfaceBlock.DetailsStagestatic interfaceBlock.IdStagestatic interfaceBlock.MetadataStagestatic interfaceBlock.ObjectStagestatic interfaceBlock.TypeStage
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Block.ObjectStagebuilder()booleanequals(java.lang.Object other)java.util.Map<java.lang.String,java.lang.Object>getAdditionalProperties()BlockBoundingBoxgetBoundingBox()java.util.Optional<java.util.List<Block>>getChildren()java.lang.StringgetContent()BlockDetailsgetDetails()java.lang.StringgetId()BlockMetadatagetMetadata()java.lang.StringgetObject()java.util.Optional<java.lang.String>getParentBlockId()java.util.List<BlockPolygonItem>getPolygon()BlockTypegetType()inthashCode()java.lang.StringtoString()
-
-
-
Method Detail
-
getObject
public java.lang.String getObject()
- Returns:
- The type of object. In this case, it will always be
"block".
-
getId
public java.lang.String getId()
- Returns:
- A unique identifier for the block, deterministically generated as a hash of the block content.
-
getParentBlockId
public java.util.Optional<java.lang.String> getParentBlockId()
- Returns:
- 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.
-
getType
public BlockType getType()
- Returns:
- 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
-
getContent
public java.lang.String getContent()
- Returns:
- The textual content of the block formatted based on the target format.
-
getDetails
public BlockDetails getDetails()
- Returns:
- Additional details specific to the block type. The schema depends on the block type.
-
getMetadata
public BlockMetadata getMetadata()
- Returns:
- Metadata about the block.
-
getPolygon
public java.util.List<BlockPolygonItem> getPolygon()
- Returns:
- An array of points defining the polygon that bounds the block.
-
getBoundingBox
public BlockBoundingBox getBoundingBox()
- Returns:
- A simplified bounding box for the block.
-
getChildren
public java.util.Optional<java.util.List<Block>> getChildren()
- Returns:
- An array of child blocks. For example, a table block may contain table cell blocks as children when
cellBlocksEnabledis set to true.
-
equals
public boolean equals(java.lang.Object other)
- Overrides:
equalsin classjava.lang.Object
-
getAdditionalProperties
public java.util.Map<java.lang.String,java.lang.Object> getAdditionalProperties()
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
builder
public static Block.ObjectStage builder()
-
-