Search in sources :

Example 1 with AAPStock

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

the class AapStockMapperTest method testAapStockMapper.

@Test
public void testAapStockMapper() {
    AAPStock aapStock = MapperUtil.getAapStock();
    AapStockEntity aapStockEntity = AapStockMapper.INSTANCE.mapToAapStockEntity(aapStock);
    assertEquals(aapStock.getID().getValue(), aapStockEntity.getStockId());
    assertEquals(aapStock.getID().getSchemeID(), aapStockEntity.getStockSchemeId());
    assertNull(aapStockEntity.getFaCatch());
}
Also used : AapStockEntity(eu.europa.ec.fisheries.ers.fa.entities.AapStockEntity) AAPStock(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.AAPStock) Test(org.junit.Test)

Example 2 with AAPStock

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

the class FaCatchMapper method getAapStockEntities.

protected Set<AapStockEntity> getAapStockEntities(List<AAPStock> aapStocks, FaCatchEntity faCatchEntity) {
    if (aapStocks == null || aapStocks.isEmpty()) {
        return Collections.emptySet();
    }
    Set<AapStockEntity> aapStockEntities = new HashSet<>();
    for (AAPStock aapStock : aapStocks) {
        AapStockEntity aapStockEntity = AapStockMapper.INSTANCE.mapToAapStockEntity(aapStock);
        aapStockEntity.setFaCatch(faCatchEntity);
        aapStockEntities.add(aapStockEntity);
    }
    return aapStockEntities;
}
Also used : AapStockEntity(eu.europa.ec.fisheries.ers.fa.entities.AapStockEntity) AAPStock(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.AAPStock) HashSet(java.util.HashSet)

Example 3 with AAPStock

use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.AAPStock 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

AAPStock (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.AAPStock)3 AapStockEntity (eu.europa.ec.fisheries.ers.fa.entities.AapStockEntity)2 HashSet (java.util.HashSet)1 Test (org.junit.Test)1 AAPProcess (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.AAPProcess)1 FACatch (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FACatch)1 FLUXCharacteristic (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXCharacteristic)1 FLUXLocation (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXLocation)1 FishingGear (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingGear)1 FishingTrip (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingTrip)1 SalesBatch (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.SalesBatch)1 SizeDistribution (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.SizeDistribution)1 CodeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)1 MeasureType (un.unece.uncefact.data.standard.unqualifieddatatype._20.MeasureType)1 QuantityType (un.unece.uncefact.data.standard.unqualifieddatatype._20.QuantityType)1