Class Chunk.Builder
- java.lang.Object
-
- ai.extend.types.Chunk.Builder
-
- All Implemented Interfaces:
Chunk._FinalStage,Chunk.ContentStage,Chunk.MetadataStage,Chunk.ObjectStage,Chunk.TypeStage
- Enclosing class:
- Chunk
public static final class Chunk.Builder extends java.lang.Object implements Chunk.ObjectStage, Chunk.TypeStage, Chunk.ContentStage, Chunk.MetadataStage, Chunk._FinalStage
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Chunk._FinalStageaddAllBlocks(java.util.List<Block> blocks)An array of block objects that make up the chunk.Chunk._FinalStageaddBlocks(Block blocks)An array of block objects that make up the chunk.Chunk._FinalStageblocks(java.util.List<Block> blocks)An array of block objects that make up the chunk.Chunkbuild()Chunk.MetadataStagecontent(java.lang.String content)The parsed content of the chunk.Chunk.Builderfrom(Chunk other)Chunk._FinalStagemetadata(ChunkMetadata metadata)Metadata about the chunk.Chunk.TypeStageobject(java.lang.String object)The type of object.Chunk.ContentStagetype(ChunkType type)The type of chunk.
-
-
-
Method Detail
-
from
public Chunk.Builder from(Chunk other)
- Specified by:
fromin interfaceChunk.ObjectStage
-
object
public Chunk.TypeStage object(@NotNull java.lang.String object)
The type of object. In this case, it will always be
"chunk".The type of object. In this case, it will always be
"chunk".- Specified by:
objectin interfaceChunk.ObjectStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
type
public Chunk.ContentStage type(@NotNull ChunkType type)
The type of chunk.
The type of chunk.
- Specified by:
typein interfaceChunk.TypeStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
content
public Chunk.MetadataStage content(@NotNull java.lang.String content)
The parsed content of the chunk.
The parsed content of the chunk.
- Specified by:
contentin interfaceChunk.ContentStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
metadata
public Chunk._FinalStage metadata(@NotNull ChunkMetadata metadata)
Metadata about the chunk.
Metadata about the chunk.
- Specified by:
metadatain interfaceChunk.MetadataStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
addAllBlocks
public Chunk._FinalStage addAllBlocks(java.util.List<Block> blocks)
An array of block objects that make up the chunk. A Block represents a distinct content element within a document, such as a paragraph of text, a heading, a table, or a figure. Blocks are the fundamental units that make up chunks in parsed documents.
- Specified by:
addAllBlocksin interfaceChunk._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
addBlocks
public Chunk._FinalStage addBlocks(Block blocks)
An array of block objects that make up the chunk. A Block represents a distinct content element within a document, such as a paragraph of text, a heading, a table, or a figure. Blocks are the fundamental units that make up chunks in parsed documents.
- Specified by:
addBlocksin interfaceChunk._FinalStage- Returns:
- Reference to
thisso that method calls can be chained together.
-
blocks
public Chunk._FinalStage blocks(java.util.List<Block> blocks)
An array of block objects that make up the chunk. A Block represents a distinct content element within a document, such as a paragraph of text, a heading, a table, or a figure. Blocks are the fundamental units that make up chunks in parsed documents.
- Specified by:
blocksin interfaceChunk._FinalStage
-
build
public Chunk build()
- Specified by:
buildin interfaceChunk._FinalStage
-
-