2026-03-24 13:42:54 +00:00

23 lines
642 B
Java

package p.packer.dtos;
import java.nio.file.Path;
import java.util.Objects;
public record PackerEmittedArtifactDTO(
String label,
Path path,
boolean canonical,
long sizeBytes) {
public PackerEmittedArtifactDTO {
label = Objects.requireNonNull(label, "label").trim();
path = Objects.requireNonNull(path, "path").toAbsolutePath().normalize();
if (label.isBlank()) {
throw new IllegalArgumentException("label must not be blank");
}
if (sizeBytes < 0L) {
throw new IllegalArgumentException("sizeBytes must not be negative");
}
}
}