class IndexationHelper {

    public IndexationResult getFullKOResult(IndexParameters indexParameters, String message) {
        IndexationResult result = new IndexationResult();
        List<IndexKO> koList = new ArrayList<>();
        if (indexParameters.getTenants() != null) {
            koList = new ArrayList<>(indexParameters.getTenants().size());
            for (Integer tenant : indexParameters.getTenants()) {
                koList.add(new IndexKO(indexParameters.getCollectionName() + "_" + tenant + "_*",
                    tenant, message));
            }
        } else {
            koList.add(new IndexKO(indexParameters.getCollectionName() + "_*", message));
        }
        result.setIndexKO(koList);
        result.setCollectionName(indexParameters.getCollectionName());
        return result;
    }

}