Search in sources :

Example 1 with SizeDistributionClassCodeEntity

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;
}
Also used : SizeDistributionClassCodeEntity(eu.europa.ec.fisheries.ers.fa.entities.SizeDistributionClassCodeEntity) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType) Sets.newHashSet(com.google.common.collect.Sets.newHashSet) HashSet(java.util.HashSet)

Example 2 with SizeDistributionClassCodeEntity

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;
}
Also used : SizeDistributionClassCodeEntity(eu.europa.ec.fisheries.ers.fa.entities.SizeDistributionClassCodeEntity) SizeDistributionEntity(eu.europa.ec.fisheries.ers.fa.entities.SizeDistributionEntity)

Example 3 with SizeDistributionClassCodeEntity

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;
}
Also used : SizeDistributionClassCodeEntity(eu.europa.ec.fisheries.ers.fa.entities.SizeDistributionClassCodeEntity) SizeDistributionEntity(eu.europa.ec.fisheries.ers.fa.entities.SizeDistributionEntity)

Aggregations

SizeDistributionClassCodeEntity (eu.europa.ec.fisheries.ers.fa.entities.SizeDistributionClassCodeEntity)3 SizeDistributionEntity (eu.europa.ec.fisheries.ers.fa.entities.SizeDistributionEntity)2 Sets.newHashSet (com.google.common.collect.Sets.newHashSet)1 HashSet (java.util.HashSet)1 CodeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)1