use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.DelimitedPeriod in project UVMS-ActivityModule-APP by UnionVMS.
the class BaseMapper method mapToFishingTripEntity.
private static FishingTripEntity mapToFishingTripEntity(FishingTrip fishingTrip) {
FishingTripEntity fishingTripEntity = FishingTripMapper.INSTANCE.mapToFishingTripEntity(fishingTrip);
List<IDType> ids = fishingTrip.getIDS();
if (CollectionUtils.isNotEmpty(ids)) {
for (IDType idType : ids) {
fishingTripEntity.addFishingTripIdentifiers(FishingTripIdentifierMapper.INSTANCE.mapToFishingTripIdentifier(idType));
}
}
List<DelimitedPeriod> specifiedDelimitedPeriods = fishingTrip.getSpecifiedDelimitedPeriods();
if (CollectionUtils.isNotEmpty(specifiedDelimitedPeriods)) {
for (DelimitedPeriod delimitedPeriod : specifiedDelimitedPeriods) {
fishingTripEntity.addDelimitedPeriods(DelimitedPeriodMapper.INSTANCE.mapToDelimitedPeriodEntity(delimitedPeriod));
}
}
return fishingTripEntity;
}
use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.DelimitedPeriod in project UVMS-ActivityModule-APP by UnionVMS.
the class MapperUtil method getDelimitedPeriod.
public static DelimitedPeriod getDelimitedPeriod() {
DateTimeType startDate = getDateTimeType("2011-07-01 11:15:00");
DateTimeType endDate = getDateTimeType("2016-07-01 11:15:00");
MeasureType measureType = getMeasureType(500, "C62", "4rhfy5-fhtydr-tyfr85-ghtyd54");
DelimitedPeriod delimitedPeriod = new DelimitedPeriod(startDate, endDate, measureType);
return delimitedPeriod;
}
use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.DelimitedPeriod in project UVMS-ActivityModule-APP by UnionVMS.
the class DelimitedPeriodMapperTest method testDelimitedPeriodMapperForFishingTrip.
@Test
public void testDelimitedPeriodMapperForFishingTrip() {
DelimitedPeriod delimitedPeriod = MapperUtil.getDelimitedPeriod();
DelimitedPeriodEntity delimitedPeriodEntity = DelimitedPeriodMapper.INSTANCE.mapToDelimitedPeriodEntity(delimitedPeriod);
assertEquals(delimitedPeriod.getStartDateTime().getDateTime().toGregorianCalendar().getTime(), delimitedPeriodEntity.getStartDate());
assertEquals(delimitedPeriod.getEndDateTime().getDateTime().toGregorianCalendar().getTime(), delimitedPeriodEntity.getEndDate());
assertEquals(delimitedPeriod.getDurationMeasure().getValue().intValue(), delimitedPeriodEntity.getDurationMeasure().getValue().intValue());
assertEquals(delimitedPeriod.getDurationMeasure().getUnitCode(), delimitedPeriodEntity.getDurationMeasure().getUnitCode());
assertEquals(delimitedPeriod.getDurationMeasure().getValue().intValue(), delimitedPeriodEntity.getCalculatedDuration().intValue());
assertNull(delimitedPeriodEntity.getFishingTrip());
}
use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.DelimitedPeriod in project UVMS-ActivityModule-APP by UnionVMS.
the class DelimitedPeriodMapperTest method testDelimitedPeriodMapperForFishingActivity.
@Test
public void testDelimitedPeriodMapperForFishingActivity() {
DelimitedPeriod delimitedPeriod = MapperUtil.getDelimitedPeriod();
DelimitedPeriodEntity delimitedPeriodEntity = DelimitedPeriodMapper.INSTANCE.mapToDelimitedPeriodEntity(delimitedPeriod);
assertEquals(delimitedPeriod.getStartDateTime().getDateTime().toGregorianCalendar().getTime(), delimitedPeriodEntity.getStartDate());
assertEquals(delimitedPeriod.getEndDateTime().getDateTime().toGregorianCalendar().getTime(), delimitedPeriodEntity.getEndDate());
assertEquals(delimitedPeriod.getDurationMeasure().getValue().intValue(), delimitedPeriodEntity.getDurationMeasure().getValue().intValue());
assertEquals(delimitedPeriod.getDurationMeasure().getUnitCode(), delimitedPeriodEntity.getDurationMeasure().getUnitCode());
assertEquals(delimitedPeriod.getDurationMeasure().getValue().intValue(), delimitedPeriodEntity.getCalculatedDuration().intValue());
assertNull(delimitedPeriodEntity.getFishingActivity());
}
Aggregations