package p.packer.models;

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

public record PackerRuntimeWalkProjection(
        List<String> availableFiles,
        List<PackerRuntimeWalkFile> buildCandidateFiles,
        long measuredBankSizeBytes) {
    public static final PackerRuntimeWalkProjection EMPTY = new PackerRuntimeWalkProjection(List.of(), List.of(), 0L);

    public PackerRuntimeWalkProjection {
        availableFiles = List.copyOf(Objects.requireNonNull(availableFiles, "availableFiles"));
        buildCandidateFiles = List.copyOf(Objects.requireNonNull(buildCandidateFiles, "buildCandidateFiles"));
        if (measuredBankSizeBytes < 0L) {
            throw new IllegalArgumentException("measuredBankSizeBytes must be non-negative");
        }
    }
}
