// 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 java.util.Map;
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;

/**
 * Image metadata extracted from image files.
 *
 * Includes dimensions, format, and EXIF data.
 */
@JsonInclude(JsonInclude.Include.NON_ABSENT)
@JsonDeserialize(builder = ImageMetadata.Builder.class)
public record ImageMetadata(
    /**
     * Image width in pixels
     */
    @JsonProperty("width") int width,
    /**
     * Image height in pixels
     */
    @JsonProperty("height") int height,
    /**
     * Image format (e.g., "PNG", "JPEG", "TIFF")
     */
    @JsonProperty("format") String format,
    /**
     * EXIF metadata tags
     */
    @JsonProperty("exif") Map<String, String> exif
) {
    public static Builder builder() {
        return new Builder();
    }

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

private int width = 0;
private int height = 0;
private String format = "";
private Map<String, String> exif = Map.of();

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

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

        /** Sets the format field. */
        @JsonProperty("format")
        public Builder withFormat(final String value) {
            this.format = value;
            return this;
        }

        /** Sets the exif field. */
        @JsonProperty("exif")
        public Builder withExif(final Map<String, String> value) {
            this.exif = value;
            return this;
        }

        /** Builds the ImageMetadata instance. */
        public ImageMetadata build() {
            return new ImageMetadata(
                width,
                height,
                format,
                exif
            );
        }
    }
    // CPD-ON
}
