package p.studio.workspaces.assets.messages;

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

public record AssetListProjection(List<AssetListGroup> groups, int visibleAssetCount) {
    public AssetListProjection {
        groups = List.copyOf(Objects.requireNonNull(groups, "groups"));
        if (visibleAssetCount < 0) {
            throw new IllegalArgumentException("visibleAssetCount must not be negative");
        }
    }

    public boolean isEmpty() {
        return visibleAssetCount == 0;
    }
}
