// 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;
import org.jspecify.annotations.Nullable;

/**
 * Language detection configuration.
 */
@JsonInclude(JsonInclude.Include.NON_ABSENT)
@JsonDeserialize(builder = LanguageDetectionConfig.Builder.class)
public record LanguageDetectionConfig(
    /**
     * Enable language detection
     */
    @Nullable @JsonProperty("enabled") Boolean enabled,
    /**
     * Minimum confidence threshold (0.0-1.0)
     */
    @Nullable @JsonProperty("min_confidence") Double minConfidence,
    /**
     * Detect multiple languages in the document
     */
    @Nullable @JsonProperty("detect_multiple") Boolean detectMultiple
) {
    public static Builder builder() {
        return new Builder();
    }

    // CPD-OFF
    @JsonPOJOBuilder(withPrefix = "with", buildMethodName = "build")
    public static final class Builder {

private Boolean enabled = null;
        @JsonProperty("min_confidence")
private Double minConfidence = null;
        @JsonProperty("detect_multiple")
private Boolean detectMultiple = null;

        /** Sets the enabled field. */
        @JsonProperty("enabled")
        public Builder withEnabled(final @Nullable Boolean value) {
            this.enabled = value;
            return this;
        }

        /** Sets the minConfidence field. */
        @JsonProperty("min_confidence")
        public Builder withMinConfidence(final @Nullable Double value) {
            this.minConfidence = value;
            return this;
        }

        /** Sets the detectMultiple field. */
        @JsonProperty("detect_multiple")
        public Builder withDetectMultiple(final @Nullable Boolean value) {
            this.detectMultiple = value;
            return this;
        }

        /** Builds the LanguageDetectionConfig instance. */
        public LanguageDetectionConfig build() {
            return new LanguageDetectionConfig(
                enabled,
                minConfidence,
                detectMultiple
            );
        }
    }
    // CPD-ON
    public static LanguageDetectionConfig defaultInstance() {
        throw new UnsupportedOperationException("defaultInstance is not yet bridged via JNI; use the Builder instead.");
    }
}
