use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.GearCharacteristic in project UVMS-ActivityModule-APP by UnionVMS.
the class BaseMapper method getGearCharacteristicEntities.
public static Set<GearCharacteristicEntity> getGearCharacteristicEntities(List<GearCharacteristic> gearCharacteristics, FishingGearEntity fishingGearEntity) {
if (CollectionUtils.isEmpty(gearCharacteristics)) {
return Collections.emptySet();
}
Set<GearCharacteristicEntity> gearCharacteristicEntities = newSet();
for (GearCharacteristic gearCharacteristic : gearCharacteristics) {
GearCharacteristicEntity gearCharacteristicEntity = GearCharacteristicsMapper.INSTANCE.mapToGearCharacteristicEntity(gearCharacteristic, fishingGearEntity, new GearCharacteristicEntity());
gearCharacteristicEntities.add(gearCharacteristicEntity);
}
return gearCharacteristicEntities;
}
use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.GearCharacteristic in project UVMS-ActivityModule-APP by UnionVMS.
the class MapperUtil method getGearCharacteristics.
public static GearCharacteristic getGearCharacteristics() {
CodeType typeCode = getCodeType("Code 1", "57t3yf-ght43yrf-ght56yru-ght7565h");
List<TextType> descriptions = Arrays.asList(getTextType("This is sample text"));
MeasureType valueMeasure = getMeasureType(123, "C62", "57t3yf-ght43yrf-ght56yru-ght7565h");
DateTimeType valueDateTime = getDateTimeType("2016-07-01 11:15:00");
IndicatorType valueIndicator = getIndicatorType(true, "Test value", "Test format");
CodeType valueCode = getCodeType("Code type 1", "4fhry5-thfyr85-67thf-5htr84");
TextType value = getTextType("This is sample Text");
QuantityType valueQuantity = getQuantityType(123);
List<FLUXLocation> specifiedFluxLocations = Arrays.asList(getFluxLocation());
GearCharacteristic gearCharacteristic = new GearCharacteristic(typeCode, descriptions, valueMeasure, valueDateTime, valueIndicator, valueCode, value, valueQuantity, specifiedFluxLocations);
return gearCharacteristic;
}
use of un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.GearCharacteristic in project UVMS-ActivityModule-APP by UnionVMS.
the class GearCharacteristicsMapperTest method testGearCharacteristicsMapper.
@Test
public void testGearCharacteristicsMapper() {
GearCharacteristic gearCharacteristic = MapperUtil.getGearCharacteristics();
GearCharacteristicEntity gearCharacteristicEntity = new GearCharacteristicEntity();
GearCharacteristicsMapper.INSTANCE.mapToGearCharacteristicEntity(gearCharacteristic, null, gearCharacteristicEntity);
assertEquals(gearCharacteristic.getTypeCode().getValue(), gearCharacteristicEntity.getTypeCode());
assertEquals(gearCharacteristic.getTypeCode().getListID(), gearCharacteristicEntity.getTypeCodeListId());
assertTrue(gearCharacteristicEntity.getDescription().startsWith(gearCharacteristic.getDescriptions().get(0).getValue()));
assertEquals(gearCharacteristic.getValueMeasure().getValue().intValue(), gearCharacteristicEntity.getValueMeasure().intValue());
assertEquals(gearCharacteristic.getValueMeasure().getUnitCode(), gearCharacteristicEntity.getValueMeasureUnitCode());
assertEquals(gearCharacteristic.getValueMeasure().getValue().intValue(), gearCharacteristicEntity.getCalculatedValueMeasure().intValue());
assertEquals(gearCharacteristic.getValueDateTime().getDateTime().toGregorianCalendar().getTime(), gearCharacteristicEntity.getValueDateTime());
assertEquals(gearCharacteristic.getValueIndicator().getIndicatorString().getValue(), gearCharacteristicEntity.getValueIndicator());
assertEquals(gearCharacteristic.getValueCode().getValue(), gearCharacteristicEntity.getValueCode());
assertTrue(gearCharacteristicEntity.getValueText().startsWith(gearCharacteristic.getValue().getValue()));
assertEquals(gearCharacteristic.getValueQuantity().getValue().intValue(), gearCharacteristicEntity.getValueQuantity().intValue());
assertEquals(gearCharacteristic.getValueQuantity().getUnitCode(), gearCharacteristicEntity.getValueQuantityCode());
assertNull(gearCharacteristicEntity.getFishingGear());
}
Aggregations