use of eu.europa.ec.fisheries.uvms.activity.model.schemas.SummaryFACatchtype in project UVMS-ActivityModule-APP by UnionVMS.
the class FACatchSummaryMapper method getFaCatchTypeSummaries.
protected List<SummaryFACatchtype> getFaCatchTypeSummaries(Map<FaCatchTypeEnum, Object> summaryFaCatchTypeMap) {
List<SummaryFACatchtype> summaryFishCatchTypes = new ArrayList<>();
if (!MapUtils.isEmpty(summaryFaCatchTypeMap)) {
for (Map.Entry<FaCatchTypeEnum, Object> entry : summaryFaCatchTypeMap.entrySet()) {
SummaryFACatchtype summaryFACatchtype = new SummaryFACatchtype();
summaryFACatchtype.setCatchType(entry.getKey());
Object value = entry.getValue();
if (value instanceof Map) {
summaryFACatchtype.setSpecies(getSpeciesCounts((Map<String, Double>) value));
} else if (value instanceof Double) {
summaryFACatchtype.setCatchTypeCount((Double) value);
}
summaryFishCatchTypes.add(summaryFACatchtype);
}
}
log.debug("SummaryFACatchtype List is created");
return summaryFishCatchTypes;
}
Aggregations