Search in sources :

Example 1 with VesselStorageCharCodeEntity

use of eu.europa.ec.fisheries.ers.fa.entities.VesselStorageCharCodeEntity in project UVMS-ActivityModule-APP by UnionVMS.

the class ActivityEntityToModelMapper method mapVesselStorageCharCodes.

private void mapVesselStorageCharCodes(VesselStorageCharacteristic target, Set<VesselStorageCharCodeEntity> vesselStorageCharCode) {
    if (CollectionUtils.isNotEmpty(vesselStorageCharCode) && target != null) {
        List<CodeType> codeTypeList = new ArrayList<>();
        for (VesselStorageCharCodeEntity source : vesselStorageCharCode) {
            CodeType codeType = new CodeType();
            codeType.setValue(source.getVesselTypeCode());
            codeType.setListID(source.getVesselTypeCodeListId());
            codeTypeList.add(codeType);
        }
        target.setTypeCodes(codeTypeList);
    }
}
Also used : VesselStorageCharCodeEntity(eu.europa.ec.fisheries.ers.fa.entities.VesselStorageCharCodeEntity) ArrayList(java.util.ArrayList) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)

Example 2 with VesselStorageCharCodeEntity

use of eu.europa.ec.fisheries.ers.fa.entities.VesselStorageCharCodeEntity in project UVMS-ActivityModule-APP by UnionVMS.

the class VesselStorageCharacteristicsMapper method mapToVesselStorageCharCodes.

protected Set<VesselStorageCharCodeEntity> mapToVesselStorageCharCodes(List<CodeType> codeTypes, VesselStorageCharacteristicsEntity vesselStorageChar) {
    if (codeTypes == null || codeTypes.isEmpty()) {
        return Collections.emptySet();
    }
    Set<VesselStorageCharCodeEntity> vesselStorageCharCodes = new HashSet<>();
    for (CodeType codeType : codeTypes) {
        VesselStorageCharCodeEntity vesselStorageCharCode = VesselStorageCharacteristicsMapper.INSTANCE.mapToVesselStorageCharCodeEntity(codeType);
        vesselStorageCharCode.setVesselStorageCharacteristics(vesselStorageChar);
        vesselStorageCharCodes.add(vesselStorageCharCode);
    }
    return vesselStorageCharCodes;
}
Also used : VesselStorageCharCodeEntity(eu.europa.ec.fisheries.ers.fa.entities.VesselStorageCharCodeEntity) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType) HashSet(java.util.HashSet)

Aggregations

VesselStorageCharCodeEntity (eu.europa.ec.fisheries.ers.fa.entities.VesselStorageCharCodeEntity)2 CodeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)2 ArrayList (java.util.ArrayList)1 HashSet (java.util.HashSet)1