Package com.tnsai.rag

Record Class ExtractedDocument

java.lang.Object
java.lang.Record
com.tnsai.rag.ExtractedDocument
Record Components:
id - stable source-local identifier
content - normalized whole-document text
format - effective concrete format
mediaType - normalized media type
source - canonical source URI
metadata - immutable document metadata
blocks - immutable structurally addressed blocks

public record ExtractedDocument(String id, String content, DocumentFormat format, String mediaType, URI source, Map<String,Object> metadata, List<DocumentBlock> blocks) extends Record
Normalized, provenance-preserving output of a ContentExtractor. Media types are limited to 256 printable ASCII characters and must contain a type/subtype slash. At most 65,536 structural blocks are admitted. Metadata values follow the immutable algebra and bounds documented by DocumentInput.
Since:
0.13.0
  • Constructor Details

    • ExtractedDocument

      public ExtractedDocument(String id, String content, DocumentFormat format, String mediaType, URI source, Map<String,Object> metadata, List<DocumentBlock> blocks)
      Creates an instance of a ExtractedDocument record class.
      Parameters:
      id - the value for the id record component
      content - the value for the content record component
      format - the value for the format record component
      mediaType - the value for the mediaType record component
      source - the value for the source record component
      metadata - the value for the metadata record component
      blocks - the value for the blocks record component
  • Method Details

    • toString

      public 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.
    • id

      public String id()
      Returns the value of the id record component.
      Returns:
      the value of the id record component
    • content

      public String content()
      Returns the value of the content record component.
      Returns:
      the value of the content record component
    • format

      public DocumentFormat format()
      Returns the value of the format record component.
      Returns:
      the value of the format record component
    • mediaType

      public String mediaType()
      Returns the value of the mediaType record component.
      Returns:
      the value of the mediaType record component
    • source

      public URI source()
      Returns the value of the source record component.
      Returns:
      the value of the source record component
    • metadata

      public Map<String,Object> metadata()
      Returns the value of the metadata record component.
      Returns:
      the value of the metadata record component
    • blocks

      public List<DocumentBlock> blocks()
      Returns the value of the blocks record component.
      Returns:
      the value of the blocks record component