use of eu.bcvsolutions.idm.acc.domain.SysValueChangeType in project CzechIdMng by bcvsolutions.
the class ChangesOnSystemReportXlsxRenderer method renderMultiValueCell.
/**
* Multi value cell renderer.
*/
private Cell renderMultiValueCell(Cell cell, SysAttributeDifferenceDto attribute) {
XSSFRichTextString content = new XSSFRichTextString();
// also defines the order of change types
SysValueChangeType[] changeTypes = { SysValueChangeType.ADDED, SysValueChangeType.REMOVED, null };
List<List<SysAttributeDifferenceValueDto>> valueList = Arrays.stream(changeTypes).map(type -> {
return attribute.getValues().stream().filter(val -> type == val.getChange()).collect(Collectors.toList());
}).collect(Collectors.toList());
for (int i = 0; i < changeTypes.length; i++) {
SysValueChangeType changeType = changeTypes[i];
List<SysAttributeDifferenceValueDto> values = valueList.get(i);
for (int j = 0; j < values.size(); ++j) {
SysAttributeDifferenceValueDto value = values.get(j);
content.append(Objects.toString(value.getValue()), getTextFont(cell, changeType));
if (j >= values.size() - 1 && i >= changeTypes.length - 1) {
continue;
}
content.append(NEW_LINE);
}
}
cell.setCellValue(content);
return cell;
}
Aggregations