// 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 coordinates for element positioning.
 */
@JsonInclude(JsonInclude.Include.NON_ABSENT)
@JsonDeserialize(builder = BoundingBox.Builder.class)
public record BoundingBox(
    /**
     * Left x-coordinate
     */
    @JsonProperty("x0") double x0,
    /**
     * Bottom y-coordinate
     */
    @JsonProperty("y0") double y0,
    /**
     * Right x-coordinate
     */
    @JsonProperty("x1") double x1,
    /**
     * Top y-coordinate
     */
    @JsonProperty("y1") double y1
) {
    public static Builder builder() {
        return new Builder();
    }

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

private double x0 = 0.0;
private double y0 = 0.0;
private double x1 = 0.0;
private double y1 = 0.0;

        /** Sets the x0 field. */
        @JsonProperty("x0")
        public Builder withX0(final double value) {
            this.x0 = value;
            return this;
        }

        /** Sets the y0 field. */
        @JsonProperty("y0")
        public Builder withY0(final double value) {
            this.y0 = value;
            return this;
        }

        /** Sets the x1 field. */
        @JsonProperty("x1")
        public Builder withX1(final double value) {
            this.x1 = value;
            return this;
        }

        /** Sets the y1 field. */
        @JsonProperty("y1")
        public Builder withY1(final double value) {
            this.y1 = value;
            return this;
        }

        /** Builds the BoundingBox instance. */
        public BoundingBox build() {
            return new BoundingBox(
                x0,
                y0,
                x1,
                y1
            );
        }
    }
    // CPD-ON
}
