use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingGear in project UVMS-ActivityModule-APP by UnionVMS.
the class MapperUtil method getStandardFishingActivity.
private static FishingActivity getStandardFishingActivity() {
List<IDType> ids = Arrays.asList(getIdType("Id_1", "fhr574fh-thrud754-kgitjf754-gjtufe89"));
CodeType typeCode = getCodeType("FISHING_OPERATION", "FLUX_FA_TYPE");
DateTimeType occurrenceDateTime = getDateTimeType("2016-07-01 11:15:00");
CodeType reasonCode = getCodeType("Reason_code_1", "FA_REASON_DEPARTURE");
CodeType vesselRelatedActivityCode = getCodeType("Vessel activity 1", "58thft-58fjd8-gt85eje-hjgute8");
CodeType fisheryTypeCode = getCodeType("Fishing_Type_code 1", "FA_FISHERY");
CodeType speciesTargetCode = getCodeType("Species code 1", "FAO_SPECIES");
QuantityType operationsQuantity = getQuantityType(100);
MeasureType fishingDurationMeasure = getMeasureType(500, "C62", "4hr2yf0-t583thf-6jgttue8-6jtie844");
List<FLAPDocument> specifiedFLAPDocument = Arrays.asList(getFlapDocument());
VesselStorageCharacteristic sourceVesselStorageCharacteristic = getVesselStorageCharacteristic();
VesselStorageCharacteristic destinationVesselStorageCharacteristic = getVesselStorageCharacteristic();
List<FACatch> specifiedFACatches = Arrays.asList(getFaCatch());
List<FLUXLocation> relatedFLUXLocations = Arrays.asList(getFluxLocation());
List<GearProblem> specifiedGearProblems = Arrays.asList(getGearProblem());
List<FLUXCharacteristic> specifiedFLUXCharacteristics = Arrays.asList(getFluxCharacteristics());
List<FishingGear> specifiedFishingGears = Arrays.asList(getFishingGear());
List<DelimitedPeriod> specifiedDelimitedPeriods = Arrays.asList(getDelimitedPeriod());
FishingTrip specifiedFishingTrip = getFishingTrip();
List<VesselTransportMeans> relatedVesselTransportMeans = Arrays.asList(getVesselTransportMeans());
FishingActivity fishingActivity = new FishingActivity(ids, typeCode, occurrenceDateTime, reasonCode, vesselRelatedActivityCode, fisheryTypeCode, speciesTargetCode, operationsQuantity, fishingDurationMeasure, specifiedFACatches, relatedFLUXLocations, specifiedGearProblems, specifiedFLUXCharacteristics, specifiedFishingGears, sourceVesselStorageCharacteristic, destinationVesselStorageCharacteristic, null, specifiedFLAPDocument, specifiedDelimitedPeriods, specifiedFishingTrip, relatedVesselTransportMeans);
return fishingActivity;
}
use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingGear in project UVMS-ActivityModule-APP by UnionVMS.
the class FishingGearMapperTest method testFishingGearMapperWithGearProblem.
@Test
public void testFishingGearMapperWithGearProblem() {
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.getGearProblem());
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());
}
use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingGear in project UVMS-ActivityModule-APP by UnionVMS.
the class FishingGearMapperTest method testFishingGearMapperWithFishingActivity.
@Test
public void testFishingGearMapperWithFishingActivity() {
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.getFishingActivity());
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());
}
use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingGear in project UVMS-ActivityModule-APP by UnionVMS.
the class FaCatchMapper method getFishingGearEntities.
protected Set<FishingGearEntity> getFishingGearEntities(List<FishingGear> fishingGears, FaCatchEntity faCatchEntity) {
if (fishingGears == null || fishingGears.isEmpty()) {
return Collections.emptySet();
}
Set<FishingGearEntity> fishingGearEntities = new HashSet<>();
for (FishingGear fishingGear : fishingGears) {
FishingGearEntity fishingGearEntity = FishingGearMapper.INSTANCE.mapToFishingGearEntity(fishingGear);
fishingGearEntity.setFaCatch(faCatchEntity);
fishingGearEntities.add(fishingGearEntity);
}
return fishingGearEntities;
}
use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingGear in project UVMS-ActivityModule-APP by UnionVMS.
the class FishingActivityMapper method getFishingGearEntities.
protected Set<FishingGearEntity> getFishingGearEntities(List<FishingGear> fishingGears, FishingActivityEntity fishingActivityEntity) {
if (fishingGears == null || fishingGears.isEmpty()) {
return Collections.emptySet();
}
Set<FishingGearEntity> fishingGearEntities = new HashSet<>();
for (FishingGear fishingGear : fishingGears) {
FishingGearEntity fishingGearEntity = FishingGearMapper.INSTANCE.mapToFishingGearEntity(fishingGear);
fishingGearEntity.setFishingActivity(fishingActivityEntity);
fishingGearEntities.add(fishingGearEntity);
}
return fishingGearEntities;
}
Aggregations