use of eu.europa.ec.fisheries.ers.fa.entities.FishingGearRoleEntity in project UVMS-ActivityModule-APP by UnionVMS.
the class BaseMapper method mapToFishingGears.
public static Set<FishingGearRoleEntity> mapToFishingGears(List<CodeType> codeTypes, FishingGearEntity fishingGearEntity) {
if (CollectionUtils.isEmpty(codeTypes)) {
Collections.emptySet();
}
Set<FishingGearRoleEntity> fishingGearRoles = newSet();
for (CodeType codeType : codeTypes) {
FishingGearRoleEntity gearRole = FishingGearMapper.INSTANCE.mapToFishingGearRoleEntity(codeType);
gearRole.setFishingGear(fishingGearEntity);
fishingGearRoles.add(gearRole);
}
return fishingGearRoles;
}
use of eu.europa.ec.fisheries.ers.fa.entities.FishingGearRoleEntity in project UVMS-ActivityModule-APP by UnionVMS.
the class BaseActivityViewMapper method fillRoleAndCharacteristics.
private void fillRoleAndCharacteristics(GearDto gearDto, FishingGearEntity gearEntity) {
Set<FishingGearRoleEntity> fishingGearRole = gearEntity.getFishingGearRole();
if (CollectionUtils.isNotEmpty(fishingGearRole)) {
FishingGearRoleEntity role = fishingGearRole.iterator().next();
gearDto.setRole(role.getRoleCode());
}
Set<GearCharacteristicEntity> gearCharacteristics = gearEntity.getGearCharacteristics();
if (CollectionUtils.isNotEmpty(gearCharacteristics)) {
for (GearCharacteristicEntity charac : gearCharacteristics) {
fillCharacteristicField(charac, gearDto);
}
}
}
use of eu.europa.ec.fisheries.ers.fa.entities.FishingGearRoleEntity in project UVMS-ActivityModule-APP by UnionVMS.
the class GearCharacteristicsMapper method fillRoleAndCharacteristics.
private void fillRoleAndCharacteristics(GearDto gearDto, FishingGearEntity gearEntity) {
Set<FishingGearRoleEntity> fishingGearRole = gearEntity.getFishingGearRole();
if (CollectionUtils.isNotEmpty(fishingGearRole)) {
FishingGearRoleEntity role = fishingGearRole.iterator().next();
gearDto.setRole(role.getRoleCode());
}
Set<GearCharacteristicEntity> gearCharacteristics = gearEntity.getGearCharacteristics();
if (CollectionUtils.isNotEmpty(gearCharacteristics)) {
for (GearCharacteristicEntity charac : gearCharacteristics) {
fillCharacteristicField(charac, gearDto);
}
}
}
Aggregations