package p.packer.models;

import java.util.List;
import java.util.Objects;

public record PackerRegisterAssetEvaluation(
        PackerResolvedAssetReference resolved,
        List<PackerDiagnostic> diagnostics,
        boolean canRegister,
        String reason) {

    public PackerRegisterAssetEvaluation {
        Objects.requireNonNull(resolved, "resolved");
        diagnostics = List.copyOf(Objects.requireNonNull(diagnostics, "diagnostics"));
        reason = reason == null ? null : reason.trim();
        if (reason != null && reason.isBlank()) {
            reason = null;
        }
    }
}
