package p.packer.models;

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

public record PackerBankCompositionDetails(
        List<PackerBankCompositionFile> availableFiles,
        List<PackerBankCompositionFile> selectedFiles,
        long measuredBankSizeBytes) {

    public static final PackerBankCompositionDetails EMPTY = new PackerBankCompositionDetails(List.of(), List.of(), 0L);

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