Record Class DocumentInput
- Record Components:
id- stable source-local identifierbytes- source bytesformat- detected concrete formatmediaType- detected or declared media typesource- canonical source URImetadata- immutable source metadata
ContentExtractor after detection.
The byte array is defensively copied on construction and access. Its
contents are deliberately omitted from toString() so diagnostics do
not disclose source documents.
Media types are limited to 256 printable ASCII characters and must contain a type/subtype slash.
Metadata accepts immutable scalar values (String, boxed primitive
values, BigInteger, BigDecimal,
URI, enums, and JDK java.time values) plus recursively nested
Map<String, ?>, collections, sets, and arrays. Containers are copied,
arrays are normalized to immutable lists, nulls and other mutable object
types are rejected. A metadata snapshot is limited to 16 levels, 4,096
keys and values, 1,048,576 characters per string, and 4,194,304 characters
across scalar values and keys. Enums are normalized to stable
declaring-class#constant-name strings.
- Since:
- 0.13.0
-
Constructor Summary
ConstructorsConstructorDescriptionDocumentInput(String id, byte[] bytes, DocumentFormat format, String mediaType, URI source, Map<String, Object> metadata) Creates an instance of aDocumentInputrecord class. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the source byte length without copying the payload.byte[]bytes()Returns the value of thebytesrecord component.booleanIndicates whether some other object is "equal to" this one.format()Returns the value of theformatrecord component.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
-
DocumentInput
public DocumentInput(String id, byte[] bytes, DocumentFormat format, String mediaType, URI source, Map<String, Object> metadata) Creates an instance of aDocumentInputrecord class.- Parameters:
id- the value for theidrecord componentbytes- the value for thebytesrecord componentformat- the value for theformatrecord componentmediaType- the value for themediaTyperecord componentsource- the value for thesourcerecord componentmetadata- the value for themetadatarecord component
-
-
Method Details
-
bytes
public byte[] bytes()Returns the value of thebytesrecord component.- Returns:
- the value of the
bytesrecord component
-
byteLength
public int byteLength()Returns the source byte length without copying the payload. -
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). -
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. -
id
Returns the value of theidrecord component.- Returns:
- the value of the
idrecord 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
-