Class DocumentResponse.Builder

java.lang.Object
ai.docling.serve.api.convert.response.DocumentResponse.Builder
Enclosing class:
DocumentResponse

public static class DocumentResponse.Builder extends Object
Builder for creating DocumentResponse instances. Generated by Lombok's @Builder annotation.

Builder methods:

  • doctagsContent(String) - Set the DocTags content
  • filename(String) - Set the filename
  • htmlContent(String) - Set the HTML content
  • jsonContent(DoclingDocument) - Set the JSON content
  • markdownContent(String) - Set the Markdown content
  • textContent(String) - Set the text content
  • Method Details

    • doctagsContent

      public @NonNull DocumentResponse.Builder doctagsContent(@Nullable String doctagsContent)
      Document content in DocTags format (if requested).
      Parameters:
      doctagsContent - the DocTags content, or null if not requested
      Returns:
      this.
    • filename

      public @NonNull DocumentResponse.Builder filename(String filename)
      Filename of the source document.
      Parameters:
      filename - the filename
      Returns:
      this.
    • htmlContent

      public @NonNull DocumentResponse.Builder htmlContent(@Nullable String htmlContent)
      Document content in HTML format (if requested).
      Parameters:
      htmlContent - the HTML content, or null if not requested
      Returns:
      this.
    • jsonContent

      public @NonNull DocumentResponse.Builder jsonContent(@Nullable ai.docling.core.DoclingDocument jsonContent)
      Document content as DoclingDocument JSON (if requested).
      Parameters:
      jsonContent - the JSON content, or null if not requested
      Returns:
      this.
    • markdownContent

      public @NonNull DocumentResponse.Builder markdownContent(@Nullable String markdownContent)
      Document content in Markdown format (if requested).
      Parameters:
      markdownContent - the Markdown content, or null if not requested
      Returns:
      this.
    • textContent

      public @NonNull DocumentResponse.Builder textContent(@Nullable String textContent)
      Document content as plain text (if requested).
      Parameters:
      textContent - the text content, or null if not requested
      Returns:
      this.
    • build

      public @NonNull DocumentResponse build()
    • toString

      public @NonNull String toString()
      Overrides:
      toString in class Object