use of eu.europa.ec.fisheries.uvms.activity.model.schemas.SummaryFishSize in project UVMS-ActivityModule-APP by UnionVMS.
the class FACatchSummaryMapper method getSummaryFishSizeList.
protected List<SummaryFishSize> getSummaryFishSizeList(Map<FishSizeClassEnum, Object> summaryFishSizeMap) {
if (MapUtils.isEmpty(summaryFishSizeMap)) {
return new ArrayList<>();
}
List<SummaryFishSize> summaryFishSizes = new ArrayList<>();
for (Map.Entry<FishSizeClassEnum, Object> entry : summaryFishSizeMap.entrySet()) {
SummaryFishSize summaryFishSize = new SummaryFishSize();
summaryFishSize.setFishSize(entry.getKey());
Object value = entry.getValue();
if (value instanceof Map) {
summaryFishSize.setSpecies(getSpeciesCounts((Map<String, Double>) value));
} else if (value instanceof Double) {
summaryFishSize.setFishSizeCount((Double) value);
}
summaryFishSizes.add(summaryFishSize);
}
log.debug("SummaryFishSize List is created");
return summaryFishSizes;
}
Aggregations