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);
}
}
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;
}
Aggregations