Files
fil/packages/java/dev/kreuzberg/BatchBytesItem.java

82 lines
2.6 KiB
Java
Raw Permalink Normal View History

2026-06-01 23:40:55 +02:00
// 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.JsonSerialize;
import com.fasterxml.jackson.databind.annotation.JsonPOJOBuilder;
import org.jspecify.annotations.Nullable;
/**
* Batch item for byte array extraction.
*
* Used with {@code batch_extract_bytes} and {@code batch_extract_bytes_sync}
* to represent a single item in a batch extraction job.
*/
@JsonInclude(JsonInclude.Include.NON_ABSENT)
@JsonDeserialize(builder = BatchBytesItem.Builder.class)
public record BatchBytesItem(
/**
* The content bytes to extract from
*/
@JsonSerialize(using = ByteArrayToIntArraySerializer.class) @JsonProperty("content") byte[] content,
/**
* MIME type of the content (e.g., "application/pdf", "text/html")
*/
@JsonProperty("mime_type") String mimeType,
/**
* Per-item configuration overrides (null uses batch-level defaults)
*/
@Nullable @JsonProperty("config") FileExtractionConfig config
) {
public static Builder builder() {
return new Builder();
}
// CPD-OFF
@JsonPOJOBuilder(withPrefix = "with", buildMethodName = "build")
public static final class Builder {
private byte[] content = new byte[0];
@JsonProperty("mime_type")
private String mimeType = "";
private FileExtractionConfig config = null;
/** Sets the content field. */
@JsonProperty("content")
public Builder withContent(final byte[] value) {
this.content = value;
return this;
}
/** Sets the mimeType field. */
@JsonProperty("mime_type")
public Builder withMimeType(final String value) {
this.mimeType = value;
return this;
}
/** Sets the config field. */
@JsonProperty("config")
public Builder withConfig(final @Nullable FileExtractionConfig value) {
this.config = value;
return this;
}
/** Builds the BatchBytesItem instance. */
public BatchBytesItem build() {
return new BatchBytesItem(
content,
mimeType,
config
);
}
}
// CPD-ON
}