// 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;

/**
 * Bounding box for an OCR-detected table in pixel coordinates.
 */
@JsonInclude(JsonInclude.Include.NON_ABSENT)
@JsonDeserialize(builder = OcrTableBoundingBox.Builder.class)
public record OcrTableBoundingBox(
    /**
     * Left x-coordinate (pixels)
     */
    @JsonProperty("left") int left,
    /**
     * Top y-coordinate (pixels)
     */
    @JsonProperty("top") int top,
    /**
     * Right x-coordinate (pixels)
     */
    @JsonProperty("right") int right,
    /**
     * Bottom y-coordinate (pixels)
     */
    @JsonProperty("bottom") int bottom
) {
    public static Builder builder() {
        return new Builder();
    }

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

private int left = 0;
private int top = 0;
private int right = 0;
private int bottom = 0;

        /** Sets the left field. */
        @JsonProperty("left")
        public Builder withLeft(final int value) {
            this.left = value;
            return this;
        }

        /** Sets the top field. */
        @JsonProperty("top")
        public Builder withTop(final int value) {
            this.top = value;
            return this;
        }

        /** Sets the right field. */
        @JsonProperty("right")
        public Builder withRight(final int value) {
            this.right = value;
            return this;
        }

        /** Sets the bottom field. */
        @JsonProperty("bottom")
        public Builder withBottom(final int value) {
            this.bottom = value;
            return this;
        }

        /** Builds the OcrTableBoundingBox instance. */
        public OcrTableBoundingBox build() {
            return new OcrTableBoundingBox(
                left,
                top,
                right,
                bottom
            );
        }
    }
    // CPD-ON
}
