Search in sources :

Example 6 with FishingGear

use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingGear in project UVMS-ActivityModule-APP by UnionVMS.

the class GearProblemMapper method getFishingGearsEntities.

protected Set<FishingGearEntity> getFishingGearsEntities(List<FishingGear> fishingGears, GearProblemEntity gearProblemEntity) {
    if (fishingGears == null || fishingGears.isEmpty()) {
        return Collections.emptySet();
    }
    Set<FishingGearEntity> fishingGearEntities = new HashSet<>();
    for (FishingGear fishingGear : fishingGears) {
        FishingGearEntity fishingGearEntity = FishingGearMapper.INSTANCE.mapToFishingGearEntity(fishingGear);
        fishingGearEntity.setGearProblem(gearProblemEntity);
        fishingGearEntities.add(fishingGearEntity);
    }
    return fishingGearEntities;
}
Also used : FishingGear(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingGear) FishingGearEntity(eu.europa.ec.fisheries.ers.fa.entities.FishingGearEntity) HashSet(java.util.HashSet)

Example 7 with FishingGear

use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingGear in project UVMS-ActivityModule-APP by UnionVMS.

the class MapperUtil method getFishingGear.

public static FishingGear getFishingGear() {
    FishingGear fishingGear = new FishingGear();
    CodeType typeCode = getCodeType("Code Type 1", "57t3yf-ght43yrf-ght56yru-ght7565h");
    List<CodeType> roleCodes = Arrays.asList(getCodeType("Role Code 1", "57t3yf-g43yrf-ght56ru-ght65h"));
    fishingGear.setTypeCode(typeCode);
    fishingGear.setRoleCodes(roleCodes);
    fishingGear.setApplicableGearCharacteristics(Arrays.asList(getGearCharacteristics()));
    return fishingGear;
}
Also used : FishingGear(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingGear) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)

Example 8 with FishingGear

use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingGear in project UVMS-ActivityModule-APP by UnionVMS.

the class MapperUtil method getGearProblem.

public static GearProblem getGearProblem() {
    CodeType typeCode = getCodeType("Code Type 1", "fhty58-gh586t-5tjf8-t58rjewe");
    QuantityType affectedQuantity = getQuantityType(222);
    List<CodeType> recoveryMeasureCodes = Arrays.asList(getCodeType("Quantity Code 1", "57t3yf-ght43yrf-ght56yru-ght7565h"));
    List<FishingGear> relatedFishingGears = Arrays.asList(getFishingGear());
    GearProblem gearProblem = new GearProblem(typeCode, affectedQuantity, recoveryMeasureCodes, Arrays.asList(getFluxLocation()), relatedFishingGears);
    return gearProblem;
}
Also used : GearProblem(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.GearProblem) QuantityType(un.unece.uncefact.data.standard.unqualifieddatatype._20.QuantityType) FishingGear(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingGear) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)

Example 9 with FishingGear

use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingGear in project UVMS-ActivityModule-APP by UnionVMS.

the class FishingGearMapperTest method testFishingGearMapperWithFaCatch.

@Test
public void testFishingGearMapperWithFaCatch() {
    FishingGear fishingGear = MapperUtil.getFishingGear();
    FishingGearEntity fishingGearEntity = FishingGearMapper.INSTANCE.mapToFishingGearEntity(fishingGear);
    assertEquals(fishingGear.getTypeCode().getValue(), fishingGearEntity.getTypeCode());
    assertEquals(fishingGear.getTypeCode().getListID(), fishingGearEntity.getTypeCodeListId());
    assertEquals(fishingGear.getRoleCodes().get(0).getValue(), fishingGearEntity.getFishingGearRole().iterator().next().getRoleCode());
    assertEquals(fishingGear.getRoleCodes().get(0).getListID(), fishingGearEntity.getFishingGearRole().iterator().next().getRoleCodeListId());
    assertNull(fishingGearEntity.getFaCatch());
    assertNotNull(fishingGearEntity.getGearCharacteristics());
    fishingGearEntity = fishingGearEntity.getGearCharacteristics().iterator().next().getFishingGear();
    assertEquals(fishingGear.getTypeCode().getValue(), fishingGearEntity.getTypeCode());
    assertEquals(fishingGear.getTypeCode().getListID(), fishingGearEntity.getTypeCodeListId());
    assertEquals(fishingGear.getRoleCodes().get(0).getValue(), fishingGearEntity.getFishingGearRole().iterator().next().getRoleCode());
    assertEquals(fishingGear.getRoleCodes().get(0).getListID(), fishingGearEntity.getFishingGearRole().iterator().next().getRoleCodeListId());
}
Also used : FishingGear(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingGear) FishingGearEntity(eu.europa.ec.fisheries.ers.fa.entities.FishingGearEntity) Test(org.junit.Test)

Example 10 with FishingGear

use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingGear in project UVMS-ActivityModule-APP by UnionVMS.

the class MapperUtil method getFaCatch.

public static FACatch getFaCatch() {
    CodeType speciesCode = getCodeType("ONBOARD", "FAO_SPECIES");
    QuantityType unitQuantity = getQuantityType(100);
    MeasureType weightMeasure = getMeasureType(123, "C62", "586jhg-5htuf95-5jfit-5jtier8");
    CodeType weighingMeansCode = getCodeType("Weighing means code 1", "5854tt5-gjtdir-5j85tui-589git");
    CodeType usageCode = getCodeType("Usage code 1", "58thft-58fjd8-gt85eje-hjgute8");
    CodeType typeCode = getCodeType("Type code 1", "FA_CATCH_TYPE");
    final List<FishingTrip> relatedFishingTrips = Arrays.asList(getFishingTrip());
    SizeDistribution specifiedSizeDistribution = getSizeDistribution();
    List<AAPStock> relatedAAPStocks = Arrays.asList(getAapStock());
    List<AAPProcess> appliedAAPProcesses = Arrays.asList(getAapProcess());
    List<SalesBatch> relatedSalesBatches = null;
    List<FLUXLocation> specifiedFLUXLocations = Arrays.asList(getFluxLocation());
    List<FishingGear> usedFishingGears = Arrays.asList(getFishingGear());
    List<FLUXCharacteristic> applicableFLUXCharacteristics = Arrays.asList(getFluxCharacteristics());
    List<FLUXLocation> destinationFLUXLocations = Arrays.asList(getFluxLocation());
    FACatch faCatch = new FACatch(speciesCode, unitQuantity, weightMeasure, weighingMeansCode, usageCode, typeCode, relatedFishingTrips, specifiedSizeDistribution, relatedAAPStocks, appliedAAPProcesses, relatedSalesBatches, specifiedFLUXLocations, usedFishingGears, applicableFLUXCharacteristics, destinationFLUXLocations);
    return faCatch;
}
Also used : SizeDistribution(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.SizeDistribution) FishingGear(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingGear) MeasureType(un.unece.uncefact.data.standard.unqualifieddatatype._20.MeasureType) AAPStock(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.AAPStock) FLUXCharacteristic(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXCharacteristic) SalesBatch(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.SalesBatch) QuantityType(un.unece.uncefact.data.standard.unqualifieddatatype._20.QuantityType) FLUXLocation(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXLocation) AAPProcess(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.AAPProcess) FishingTrip(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingTrip) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType) FACatch(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FACatch)

Aggregations

FishingGear (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingGear)10 FishingGearEntity (eu.europa.ec.fisheries.ers.fa.entities.FishingGearEntity)6 CodeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)4 HashSet (java.util.HashSet)3 Test (org.junit.Test)3 QuantityType (un.unece.uncefact.data.standard.unqualifieddatatype._20.QuantityType)3 FACatch (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FACatch)2 FLUXCharacteristic (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXCharacteristic)2 FLUXLocation (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXLocation)2 FishingTrip (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingTrip)2 GearProblem (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.GearProblem)2 MeasureType (un.unece.uncefact.data.standard.unqualifieddatatype._20.MeasureType)2 AAPProcess (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.AAPProcess)1 AAPStock (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.AAPStock)1 DelimitedPeriod (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.DelimitedPeriod)1 FLAPDocument (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLAPDocument)1 FishingActivity (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingActivity)1 SalesBatch (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.SalesBatch)1 SizeDistribution (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.SizeDistribution)1 VesselStorageCharacteristic (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselStorageCharacteristic)1