package tech.easyflow.ai.document.model;

import com.easyagents.document.core.entity.DocumentBlock;
import com.easyagents.document.core.entity.DocumentImage;
import com.easyagents.document.core.entity.DocumentPage;
import com.easyagents.document.core.entity.DocumentTable;

import java.util.ArrayList;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;

/**
 * 标准化单文档解析结果。
 *
 * @author Codex
 * @since 2026-04-14
 */
public class DocumentParsedResult {

    private String fileName;
    private String preferredText;
    private String markdown;
    private String plainText;
    private List<DocumentPage> pages = new ArrayList<DocumentPage>();
    private List<DocumentBlock> blocks = new ArrayList<DocumentBlock>();
    private List<DocumentTable> tables = new ArrayList<DocumentTable>();
    private List<DocumentImage> images = new ArrayList<DocumentImage>();
    private List<String> warnings = new ArrayList<String>();
    private Map<String, Object> metadata = new LinkedHashMap<String, Object>();
    private DocumentParseArtifacts artifacts = new DocumentParseArtifacts();

    public String getFileName() {
        return fileName;
    }

    public void setFileName(String fileName) {
        this.fileName = fileName;
    }

    public String getPreferredText() {
        return preferredText;
    }

    public void setPreferredText(String preferredText) {
        this.preferredText = preferredText;
    }

    public String getMarkdown() {
        return markdown;
    }

    public void setMarkdown(String markdown) {
        this.markdown = markdown;
    }

    public String getPlainText() {
        return plainText;
    }

    public void setPlainText(String plainText) {
        this.plainText = plainText;
    }

    public List<DocumentPage> getPages() {
        return pages;
    }

    public void setPages(List<DocumentPage> pages) {
        this.pages = pages == null ? new ArrayList<DocumentPage>() : pages;
    }

    public List<DocumentBlock> getBlocks() {
        return blocks;
    }

    public void setBlocks(List<DocumentBlock> blocks) {
        this.blocks = blocks == null ? new ArrayList<DocumentBlock>() : blocks;
    }

    public List<DocumentTable> getTables() {
        return tables;
    }

    public void setTables(List<DocumentTable> tables) {
        this.tables = tables == null ? new ArrayList<DocumentTable>() : tables;
    }

    public List<DocumentImage> getImages() {
        return images;
    }

    public void setImages(List<DocumentImage> images) {
        this.images = images == null ? new ArrayList<DocumentImage>() : images;
    }

    public List<String> getWarnings() {
        return warnings;
    }

    public void setWarnings(List<String> warnings) {
        this.warnings = warnings == null ? new ArrayList<String>() : warnings;
    }

    public Map<String, Object> getMetadata() {
        return metadata;
    }

    public void setMetadata(Map<String, Object> metadata) {
        this.metadata = metadata == null ? new LinkedHashMap<String, Object>() : metadata;
    }

    public DocumentParseArtifacts getArtifacts() {
        return artifacts;
    }

    public void setArtifacts(DocumentParseArtifacts artifacts) {
        this.artifacts = artifacts == null ? new DocumentParseArtifacts() : artifacts;
    }
}
