// 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.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

/**
 * Semantic element type classification.
 *
 * Categorizes text content into semantic units for downstream processing.
 * Supports the element types commonly found in Unstructured documents.
 */
public enum ElementType {
    /** Document title */
    Title("title"),
    /** Main narrative text body */
    NarrativeText("narrative_text"),
    /** Section heading */
    Heading("heading"),
    /** List item (bullet, numbered, etc.) */
    ListItem("list_item"),
    /** Table element */
    Table("table"),
    /** Image element */
    Image("image"),
    /** Page break marker */
    PageBreak("page_break"),
    /** Code block */
    CodeBlock("code_block"),
    /** Block quote */
    BlockQuote("block_quote"),
    /** Footer text */
    Footer("footer"),
    /** Header text */
    Header("header");

    /** The string value. */
    private final String value;

    ElementType(final String value) {
        this.value = value;
    }

    /** Returns the string value. */
    @JsonValue
    public String getValue() {
        return value;
    }

    /** Creates an instance from a string value. */
    @JsonCreator
    public static ElementType fromValue(final String value) {
        for (ElementType e : values()) {
            if (e.value.equalsIgnoreCase(value)) {
                return e;
            }
        }
        throw new IllegalArgumentException("Unknown value: " + value);
    }

    /** Returns the wire-format string value (matches JSON serialization). */
    @Override
    public String toString() {
        return value;
    }
}
