use of org.eclipse.sw360.components.summary.SummaryType in project sw360portal by sw360.
the class ReleaseSummary method summary.
protected Release summary(SummaryType type, Release document, Function<String, Vendor> vendorProvider) {
Release copy = new Release();
if (type == SummaryType.DETAILED_EXPORT_SUMMARY) {
setDetailedExportSummaryFields(document, copy);
} else {
setShortSummaryFields(document, copy);
if (type != SummaryType.SHORT) {
setAdditionalFieldsForSummariesOtherThanShortAndDetailedExport(document, copy);
}
}
if (document.isSetVendorId()) {
final String vendorId = document.getVendorId();
if (!Strings.isNullOrEmpty(vendorId)) {
Vendor vendor = vendorProvider.apply(vendorId);
copy.setVendor(vendor);
}
}
return copy;
}
Aggregations