package tech.easyflow.agent.runtime.document;

import com.easyagents.core.file2text.DocumentTextSegment;

import java.util.ArrayList;
import java.util.List;

/**
 * 保存在私有对象存储中的不可变文档读取快照。
 */
public class AgentDocumentReadSnapshot {

    private String readSnapshotId;
    private String attachmentId;
    private String fileSha256;
    private String readerVersion;
    private String readPolicyVersion;
    private int charCount;
    private int tokenEstimate;
    private List<DocumentTextSegment> segments = new ArrayList<>();

    /** @return 快照 ID */
    public String getReadSnapshotId() { return readSnapshotId; }
    /** @param readSnapshotId 快照 ID */
    public void setReadSnapshotId(String readSnapshotId) { this.readSnapshotId = readSnapshotId; }
    /** @return 附件 ID */
    public String getAttachmentId() { return attachmentId; }
    /** @param attachmentId 附件 ID */
    public void setAttachmentId(String attachmentId) { this.attachmentId = attachmentId; }
    /** @return 文件 SHA-256 */
    public String getFileSha256() { return fileSha256; }
    /** @param fileSha256 文件 SHA-256 */
    public void setFileSha256(String fileSha256) { this.fileSha256 = fileSha256; }
    /** @return 读取器版本 */
    public String getReaderVersion() { return readerVersion; }
    /** @param readerVersion 读取器版本 */
    public void setReaderVersion(String readerVersion) { this.readerVersion = readerVersion; }
    /** @return 读取策略版本 */
    public String getReadPolicyVersion() { return readPolicyVersion; }
    /** @param readPolicyVersion 读取策略版本 */
    public void setReadPolicyVersion(String readPolicyVersion) { this.readPolicyVersion = readPolicyVersion; }
    /** @return 字符数 */
    public int getCharCount() { return charCount; }
    /** @param charCount 字符数 */
    public void setCharCount(int charCount) { this.charCount = charCount; }
    /** @return Token 估算 */
    public int getTokenEstimate() { return tokenEstimate; }
    /** @param tokenEstimate Token 估算 */
    public void setTokenEstimate(int tokenEstimate) { this.tokenEstimate = tokenEstimate; }
    /** @return 结构化片段 */
    public List<DocumentTextSegment> getSegments() { return segments; }
    /** @param segments 结构化片段 */
    public void setSegments(List<DocumentTextSegment> segments) {
        this.segments = segments == null ? new ArrayList<>() : new ArrayList<>(segments);
    }
}
