use of eu.europa.ec.fisheries.ers.fa.entities.SizeDistributionClassCodeEntity in project UVMS-ActivityModule-APP by UnionVMS.
the class BaseMapper method mapToSizeDistributionClassCodes.
public static Set<SizeDistributionClassCodeEntity> mapToSizeDistributionClassCodes(List<CodeType> codeTypes, SizeDistributionEntity sizeDistributionEntity) {
if (codeTypes == null || codeTypes.isEmpty()) {
Collections.emptySet();
}
Set<SizeDistributionClassCodeEntity> classCodes = new HashSet<>();
for (CodeType codeType : codeTypes) {
SizeDistributionClassCodeEntity entity = SizeDistributionMapper.INSTANCE.mapToSizeDistributionClassCodeEntity(codeType);
entity.setSizeDistribution(sizeDistributionEntity);
classCodes.add(entity);
}
return classCodes;
}
use of eu.europa.ec.fisheries.ers.fa.entities.SizeDistributionClassCodeEntity in project UVMS-ActivityModule-APP by UnionVMS.
the class FaCatchMapper method getSizeDistributionEntity.
protected SizeDistributionEntity getSizeDistributionEntity(SizeDistribution sizeDistribution, FaCatchEntity faCatchEntity) {
if (sizeDistribution == null) {
return null;
}
SizeDistributionEntity sizeDistributionEntity = SizeDistributionMapper.INSTANCE.mapToSizeDistributionEntity(sizeDistribution);
sizeDistributionEntity.setFaCatch(faCatchEntity);
Set<SizeDistributionClassCodeEntity> sizeDistributionSet = sizeDistributionEntity.getSizeDistributionClassCode();
if (CollectionUtils.isNotEmpty(sizeDistributionSet)) {
faCatchEntity.setFishClassCode(sizeDistributionSet.iterator().next().getClassCode());
}
return sizeDistributionEntity;
}
use of eu.europa.ec.fisheries.ers.fa.entities.SizeDistributionClassCodeEntity in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityDataUtil method getSizeDistributionEntity.
public static SizeDistributionEntity getSizeDistributionEntity(String classCode, String classCodeListId, String categoryCode, String categoryCodeListId) {
SizeDistributionEntity sizeDistributionEntity = new SizeDistributionEntity();
SizeDistributionClassCodeEntity entity = new SizeDistributionClassCodeEntity();
entity.setClassCode(classCode);
entity.setClassCodeListId(classCodeListId);
sizeDistributionEntity.setSizeDistributionClassCode(new HashSet<>(Arrays.asList(entity)));
sizeDistributionEntity.setCategoryCode(categoryCode);
sizeDistributionEntity.setCategoryCodeListId(categoryCodeListId);
return sizeDistributionEntity;
}
Aggregations