Record Class ParsedDocument
java.lang.Object
java.lang.Record
ai.doctruth.ParsedDocument
- Record Components:
docId- a stable identifier for this document (e.g. content hash, UUID, file path).sections- the parsed sections in document order.metadata- document-level metadata.
public record ParsedDocument(String docId, List<ParsedSection> sections, DocumentMetadata metadata)
extends Record
The output of Layer 1 (document parsing): a stable identifier, an ordered list of
sections, and the document metadata.
Invariants (enforced by the compact constructor):
docIdis non-null and non-blank.sectionsis non-null (empty list allowed).metadatais non-null.
The sections list is defensively copied on construction and exposed as
unmodifiable, so neither the caller's input nor the accessor's return value can mutate
the document's state.
- Since:
- 0.1.0
-
Constructor Summary
ConstructorsConstructorDescriptionParsedDocument(String docId, List<ParsedSection> sections, DocumentMetadata metadata) Creates an instance of aParsedDocumentrecord class. -
Method Summary
Modifier and TypeMethodDescriptiondocId()Returns the value of thedocIdrecord component.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.metadata()Returns the value of themetadatarecord component.sections()Returns the value of thesectionsrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
Method Details
-
toString
-
hashCode
-
equals
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 withObjects::equals(Object,Object). -
docId
-
sections
-
metadata
-