use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingTrip in project UVMS-ActivityModule-APP by UnionVMS.
the class BaseMapper method mapToFishingTripEntitySet.
public static Set<FishingTripEntity> mapToFishingTripEntitySet(List<FishingTrip> fishingTrips, FaCatchEntity faCatchEntity) {
if (fishingTrips == null || fishingTrips.isEmpty()) {
return Collections.emptySet();
}
Set<FishingTripEntity> fishingTripEntities = new HashSet<>();
for (FishingTrip fishingTrip : fishingTrips) {
FishingTripEntity fishingTripEntity = mapToFishingTripEntity(fishingTrip);
fishingTripEntity.setFaCatch(faCatchEntity);
fishingTripEntities.add(fishingTripEntity);
}
return fishingTripEntities;
}
use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingTrip in project UVMS-ActivityModule-APP by UnionVMS.
the class FishingTripMapperTest method getFishingTripWithFishingActivity.
@Test
public void getFishingTripWithFishingActivity() {
FishingTrip fishingTrip = MapperUtil.getFishingTrip();
FishingTripEntity fishingTripEntity = FishingTripMapper.INSTANCE.mapToFishingTripEntity(fishingTrip);
assertEquals(fishingTrip.getTypeCode().getValue(), fishingTripEntity.getTypeCode());
assertEquals(fishingTrip.getTypeCode().getListID(), fishingTripEntity.getTypeCodeListId());
assertNull(fishingTripEntity.getFishingActivity());
assertNotNull(fishingTripEntity.getDelimitedPeriods());
assertNotNull(fishingTripEntity.getFishingTripIdentifiers());
}
use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingTrip 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;
}
Aggregations