package p.packer.dtos; import p.packer.messages.diagnostics.PackerDiagnosticCategory; import p.packer.messages.diagnostics.PackerDiagnosticSeverity; import java.nio.file.Path; import java.util.Objects; public record PackerDiagnosticDTO( PackerDiagnosticSeverity severity, PackerDiagnosticCategory category, String message, Path evidencePath, boolean blocking) { public PackerDiagnosticDTO { Objects.requireNonNull(severity, "severity"); Objects.requireNonNull(category, "category"); message = Objects.requireNonNull(message, "message").trim(); evidencePath = evidencePath == null ? null : evidencePath.toAbsolutePath().normalize(); if (message.isBlank()) { throw new IllegalArgumentException("message must not be blank"); } } }