Class DocumentResponse
java.lang.Object
ai.docling.serve.api.convert.response.DocumentResponse
A simple mutable POJO representing the converted document returned by the
Docling Convert API. The properties map 1:1 to the JSON payload using the
JsonProperty names declared on each field.
Serialization is configured with JsonInclude.Include.NON_EMPTY,
meaning nulls, empty strings, and empty collections/maps are omitted from the
serialized JSON.
Notes on mutability and maps:
jsonContentdefaults to an empty map and is never exposed asnull. The getter returns an unmodifiable view.- When setting
jsonContentwith a non-null map, the reference is preserved; subsequent external modifications to the provided map are observable viagetJsonContent().
-
Nested Class Summary
Nested Classes -
Method Summary
Modifier and TypeMethodDescriptionstatic @NonNull DocumentResponse.Builderbuilder()@Nullable StringDocument content in DocTags format (if requested).Filename of the source document.@Nullable StringDocument content in HTML format (if requested).@Nullable ai.docling.core.DoclingDocumentDocument content as DoclingDocument JSON (if requested).@Nullable StringDocument content in Markdown format (if requested).@Nullable StringDocument content as plain text (if requested).@NonNull DocumentResponse.Builder@NonNull StringtoString()
-
Method Details
-
builder
-
toBuilder
-
getDoctagsContent
Document content in DocTags format (if requested).- Returns:
- the DocTags content, or null if not requested
-
getFilename
Filename of the source document.- Returns:
- the filename
-
getHtmlContent
Document content in HTML format (if requested).- Returns:
- the HTML content, or null if not requested
-
getJsonContent
public @Nullable ai.docling.core.DoclingDocument getJsonContent()Document content as DoclingDocument JSON (if requested).- Returns:
- the JSON content, or null if not requested
-
getMarkdownContent
Document content in Markdown format (if requested).- Returns:
- the Markdown content, or null if not requested
-
getTextContent
Document content as plain text (if requested).- Returns:
- the text content, or null if not requested
-
toString
-