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

/**
 * XML metadata extracted during XML parsing.
 *
 * Provides statistics about XML document structure.
 */
@JsonInclude(JsonInclude.Include.NON_ABSENT)
@JsonDeserialize(builder = XmlMetadata.Builder.class)
public record XmlMetadata(
    /**
     * Total number of XML elements processed
     */
    @JsonProperty("element_count") int elementCount,
    /**
     * List of unique element tag names (sorted)
     */
    @JsonProperty("unique_elements") List<String> uniqueElements
) {
    public static Builder builder() {
        return new Builder();
    }

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

        @JsonProperty("element_count")
private int elementCount = 0;
        @JsonProperty("unique_elements")
private List<String> uniqueElements = List.of();

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

        /** Sets the uniqueElements field. */
        @JsonProperty("unique_elements")
        public Builder withUniqueElements(final List<String> value) {
            this.uniqueElements = value;
            return this;
        }

        /** Builds the XmlMetadata instance. */
        public XmlMetadata build() {
            return new XmlMetadata(
                elementCount,
                uniqueElements
            );
        }
    }
    // CPD-ON
}
