// 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 extraction result.
 *
 * Contains extracted text content from XML files along with
 * structural statistics about the XML document.
 */
@JsonInclude(JsonInclude.Include.NON_ABSENT)
@JsonDeserialize(builder = XmlExtractionResult.Builder.class)
public record XmlExtractionResult(
    /**
     * Extracted text content (XML structure filtered out)
     */
    @JsonProperty("content") String content,
    /**
     * Total number of XML elements processed
     */
    @JsonProperty("element_count") long elementCount,
    /**
     * List of unique element names found (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 {

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

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

        /** Sets the elementCount field. */
        @JsonProperty("element_count")
        public Builder withElementCount(final long 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 XmlExtractionResult instance. */
        public XmlExtractionResult build() {
            return new XmlExtractionResult(
                content,
                elementCount,
                uniqueElements
            );
        }
    }
    // CPD-ON
}
