package com.easyagents.skill.validation;

import java.io.Serial;
import java.io.Serializable;
import java.util.Objects;

/**
 * 可定位的 Skill 校验问题。
 */
public final class SkillValidationIssue implements Serializable {

    @Serial
    private static final long serialVersionUID = 1L;

    private final String code;
    private final SkillValidationSeverity severity;
    private final String path;
    private final Integer line;
    private final Integer column;
    private final String message;
    private final String suggestion;

    /**
     * 创建 Skill 校验问题。
     *
     * @param code 稳定问题码
     * @param severity 严重级别
     * @param path 文件路径
     * @param line 一基行号
     * @param column 一基列号
     * @param message 问题说明
     * @param suggestion 修复建议
     */
    public SkillValidationIssue(String code, SkillValidationSeverity severity, String path,
                                Integer line, Integer column, String message, String suggestion) {
        this.code = Objects.requireNonNull(code, "code");
        this.severity = Objects.requireNonNull(severity, "severity");
        this.path = path;
        this.line = line;
        this.column = column;
        this.message = Objects.requireNonNull(message, "message");
        this.suggestion = suggestion;
    }

    /** @return 稳定问题码 */
    public String getCode() {
        return code;
    }

    /** @return 严重级别 */
    public SkillValidationSeverity getSeverity() {
        return severity;
    }

    /** @return 文件路径 */
    public String getPath() {
        return path;
    }

    /** @return 一基行号 */
    public Integer getLine() {
        return line;
    }

    /** @return 一基列号 */
    public Integer getColumn() {
        return column;
    }

    /** @return 问题说明 */
    public String getMessage() {
        return message;
    }

    /** @return 修复建议 */
    public String getSuggestion() {
        return suggestion;
    }
}
