package de.gecheckt.pdf.umbenenner.domain.model;

import java.util.Objects;

/**
 * Represents successful PDF text extraction.
 * <p>
 * When this result is obtained, both text content and page count have been
 * successfully extracted and are guaranteed to be valid.
 *
 * @param extractedText the full text content extracted from the PDF (non-null, may be empty string)
 * @param pageCount the number of pages in the PDF (non-null, validated &gt;= 1)
 */
public record PdfExtractionSuccess(
    String extractedText,
    PdfPageCount pageCount
) implements PdfExtractionResult {
    /**
     * Constructor with validation.
     *
     * @param extractedText must be non-null (may be empty)
     * @param pageCount must be non-null
     * @throws NullPointerException if either parameter is null
     */
    public PdfExtractionSuccess {
        Objects.requireNonNull(extractedText, "extractedText must not be null");
        Objects.requireNonNull(pageCount, "pageCount must not be null");
    }
}
