// 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 layout detection result.
 */
@JsonInclude(JsonInclude.Include.NON_ABSENT)
@JsonDeserialize(builder = LayoutDetection.Builder.class)
public record LayoutDetection(
    @JsonProperty("class_name") LayoutClass className,
    @JsonProperty("confidence") float confidence,
    @JsonProperty("bbox") BBox bbox
) {
    public static Builder builder() {
        return new Builder();
    }

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

        @JsonProperty("class_name")
private LayoutClass className = null;
private float confidence = 0.0f;
private BBox bbox = null;

        /** Sets the className field. */
        @JsonProperty("class_name")
        public Builder withClassName(final LayoutClass value) {
            this.className = value;
            return this;
        }

        /** Sets the confidence field. */
        @JsonProperty("confidence")
        public Builder withConfidence(final float value) {
            this.confidence = value;
            return this;
        }

        /** Sets the bbox field. */
        @JsonProperty("bbox")
        public Builder withBbox(final BBox value) {
            this.bbox = value;
            return this;
        }

        /** Builds the LayoutDetection instance. */
        public LayoutDetection build() {
            return new LayoutDetection(
                className,
                confidence,
                bbox
            );
        }
    }
    // CPD-ON
}
