80 lines
2.3 KiB
Java
Generated
80 lines
2.3 KiB
Java
Generated
// This file is auto-generated by alef — DO NOT EDIT.
|
|
// alef:hash:4e15143f4af1ae8bafbdb1506ef057da924484c66a19483966333558ad437e75
|
|
// To regenerate: alef generate
|
|
// To verify freshness: alef verify --exit-code
|
|
// Issues & docs: https://github.com/kreuzberg-dev/alef
|
|
package dev.kreuzberg;
|
|
|
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
|
import com.fasterxml.jackson.annotation.JsonInclude;
|
|
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
|
|
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
|
|
|
|
/**
|
|
* A single file extracted from an archive.
|
|
*
|
|
* When archives (ZIP, TAR, 7Z, GZIP) are extracted with recursive extraction
|
|
* enabled, each processable file produces its own full {@code ExtractionResult}.
|
|
*/
|
|
@JsonInclude(JsonInclude.Include.NON_ABSENT)
|
|
@JsonDeserialize(builder = ArchiveEntry.Builder.class)
|
|
public record ArchiveEntry(
|
|
/**
|
|
* Archive-relative file path (e.g. "folder/document.pdf").
|
|
*/
|
|
@JsonProperty("path") String path,
|
|
/**
|
|
* Detected MIME type of the file.
|
|
*/
|
|
@JsonProperty("mime_type") String mimeType,
|
|
/**
|
|
* Full extraction result for this file.
|
|
*/
|
|
@JsonProperty("result") ExtractionResult result
|
|
) {
|
|
public static Builder builder() {
|
|
return new Builder();
|
|
}
|
|
|
|
// CPD-OFF
|
|
@JsonPOJOBuilder(withPrefix = "with", buildMethodName = "build")
|
|
public static final class Builder {
|
|
|
|
private String path = "";
|
|
@JsonProperty("mime_type")
|
|
private String mimeType = "";
|
|
private ExtractionResult result = null;
|
|
|
|
/** Sets the path field. */
|
|
@JsonProperty("path")
|
|
public Builder withPath(final String value) {
|
|
this.path = value;
|
|
return this;
|
|
}
|
|
|
|
/** Sets the mimeType field. */
|
|
@JsonProperty("mime_type")
|
|
public Builder withMimeType(final String value) {
|
|
this.mimeType = value;
|
|
return this;
|
|
}
|
|
|
|
/** Sets the result field. */
|
|
@JsonProperty("result")
|
|
public Builder withResult(final ExtractionResult value) {
|
|
this.result = value;
|
|
return this;
|
|
}
|
|
|
|
/** Builds the ArchiveEntry instance. */
|
|
public ArchiveEntry build() {
|
|
return new ArchiveEntry(
|
|
path,
|
|
mimeType,
|
|
result
|
|
);
|
|
}
|
|
}
|
|
// CPD-ON
|
|
}
|