Record Class DocumentResult

java.lang.Object
java.lang.Record
com.tnsai.tools.document.docling.DocumentResult
Record Components:
markdown - document content exported as Markdown
tables - lossless JSON table objects, or Markdown tables when the provider exposes only Markdown
formulas - formula text discovered in the structured document
figures - lossless JSON picture objects, or Markdown image targets
doclingJson - lossless DoclingDocument JSON when the provider exposes it

public record DocumentResult(String markdown, List<String> tables, List<String> formulas, List<String> figures, String doclingJson) extends Record
Immutable normalized output from a Docling conversion.
  • Constructor Details

    • DocumentResult

      public DocumentResult(String markdown, List<String> tables, List<String> formulas, List<String> figures, String doclingJson)
      Creates an instance of a DocumentResult record class.
      Parameters:
      markdown - the value for the markdown record component
      tables - the value for the tables record component
      formulas - the value for the formulas record component
      figures - the value for the figures record component
      doclingJson - the value for the doclingJson record component
  • Method Details

    • hasStructuredContent

      public boolean hasStructuredContent()
      Returns whether Docling exposed any structured table, formula, or figure.
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • markdown

      public String markdown()
      Returns the value of the markdown record component.
      Returns:
      the value of the markdown record component
    • tables

      public List<String> tables()
      Returns the value of the tables record component.
      Returns:
      the value of the tables record component
    • formulas

      public List<String> formulas()
      Returns the value of the formulas record component.
      Returns:
      the value of the formulas record component
    • figures

      public List<String> figures()
      Returns the value of the figures record component.
      Returns:
      the value of the figures record component
    • doclingJson

      public String doclingJson()
      Returns the value of the doclingJson record component.
      Returns:
      the value of the doclingJson record component