Search in sources :

Example 1 with SummaryFACatchtype

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;
}
Also used : FaCatchTypeEnum(eu.europa.ec.fisheries.uvms.activity.model.schemas.FaCatchTypeEnum) SummaryFACatchtype(eu.europa.ec.fisheries.uvms.activity.model.schemas.SummaryFACatchtype) ArrayList(java.util.ArrayList) EnumMap(java.util.EnumMap) HashMap(java.util.HashMap) Map(java.util.Map)

Aggregations

FaCatchTypeEnum (eu.europa.ec.fisheries.uvms.activity.model.schemas.FaCatchTypeEnum)1 SummaryFACatchtype (eu.europa.ec.fisheries.uvms.activity.model.schemas.SummaryFACatchtype)1 ArrayList (java.util.ArrayList)1 EnumMap (java.util.EnumMap)1 HashMap (java.util.HashMap)1 Map (java.util.Map)1