use of org.ovirt.engine.core.common.businessentities.ErrataCount in project ovirt-engine by oVirt.
the class KatelloProvider method addErrataCountForType.
private void addErrataCountForType(ErrataData errataData, Erratum.ErrataType errataType) {
Stream<Erratum> typedErrata = errataData.getErrata().stream().filter(erratum -> erratum.getType() == errataType);
long totalCount = typedErrata.count();
if (totalCount > 0) {
Map<Erratum.ErrataSeverity, Long> errataBySeverity = errataData.getErrata().stream().collect(Collectors.groupingBy(Erratum::getSeverityOrDefault, Collectors.counting()));
ErrataCount errataCount = new ErrataCount();
errataCount.setTotalCount((int) totalCount);
errataBySeverity.entrySet().forEach(entry -> errataCount.getCountBySeverity().put(entry.getKey(), entry.getValue().intValue()));
errataData.getErrataCounts().getErrataCountByType().put(errataType, errataCount);
}
}
Aggregations