Package com.tnsai.rag
Record Class ExtractedDocument
java.lang.Object
java.lang.Record
com.tnsai.rag.ExtractedDocument
- Record Components:
id- stable source-local identifiercontent- normalized whole-document textformat- effective concrete formatmediaType- normalized media typesource- canonical source URImetadata- immutable document metadatablocks- 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 Summary
ConstructorsConstructorDescriptionExtractedDocument(String id, String content, DocumentFormat format, String mediaType, URI source, Map<String, Object> metadata, List<DocumentBlock> blocks) Creates an instance of aExtractedDocumentrecord class. -
Method Summary
Modifier and TypeMethodDescriptionblocks()Returns the value of theblocksrecord component.content()Returns the value of thecontentrecord component.final booleanIndicates whether some other object is "equal to" this one.format()Returns the value of theformatrecord component.final inthashCode()Returns a hash code value for this object.id()Returns the value of theidrecord component.Returns the value of themediaTyperecord component.metadata()Returns the value of themetadatarecord component.source()Returns the value of thesourcerecord component.toString()Returns a string representation of this record class.
-
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 aExtractedDocumentrecord class.- Parameters:
id- the value for theidrecord componentcontent- the value for thecontentrecord componentformat- the value for theformatrecord componentmediaType- the value for themediaTyperecord componentsource- the value for thesourcerecord componentmetadata- the value for themetadatarecord componentblocks- the value for theblocksrecord component
-
-
Method Details
-
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. -
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. -
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). -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord component
-
content
Returns the value of thecontentrecord component.- Returns:
- the value of the
contentrecord component
-
format
Returns the value of theformatrecord component.- Returns:
- the value of the
formatrecord component
-
mediaType
Returns the value of themediaTyperecord component.- Returns:
- the value of the
mediaTyperecord component
-
source
Returns the value of thesourcerecord component.- Returns:
- the value of the
sourcerecord component
-
metadata
Returns the value of themetadatarecord component.- Returns:
- the value of the
metadatarecord component
-
blocks
Returns the value of theblocksrecord component.- Returns:
- the value of the
blocksrecord component
-