Search in sources :

Example 6 with FLUXCharacteristic

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

the class ActivityEntityToModelMapper method mapValues.

private void mapValues(FLUXCharacteristic target, FluxCharacteristicEntity source) {
    if (ObjectUtils.allNotNull(target, source)) {
        String valueText = source.getValueText();
        if (StringUtils.isNotEmpty(valueText)) {
            TextType textType = new TextType();
            textType.setValue(valueText);
            target.setValues(Collections.singletonList(textType));
        }
    }
}
Also used : TextType(un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType)

Example 7 with FLUXCharacteristic

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

the class ActivityEntityToModelMapper method mapValueCode.

private void mapValueCode(FLUXCharacteristic target, FluxCharacteristicEntity source) {
    if (ObjectUtils.allNotNull(target, source)) {
        if (source.getValueCode() != null) {
            CodeType codeType = new CodeType();
            codeType.setValue(source.getValueCode());
            target.setTypeCode(codeType);
        }
    }
}
Also used : CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)

Example 8 with FLUXCharacteristic

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

the class ActivityEntityToModelMapper method mapValueMeasure.

private void mapValueMeasure(FLUXCharacteristic target, FluxCharacteristicEntity source) {
    if (ObjectUtils.allNotNull(target, source)) {
        Double valueMeasure = source.getValueMeasure();
        String valueMeasureUnitCode = source.getValueMeasureUnitCode();
        if (valueMeasure != null || StringUtils.isNotEmpty(valueMeasureUnitCode)) {
            MeasureType measureType = new MeasureType();
            if (valueMeasure != null) {
                measureType.setValue(new BigDecimal(valueMeasure));
            }
            if (StringUtils.isNotEmpty(valueMeasureUnitCode)) {
                measureType.setUnitCode(valueMeasureUnitCode);
            }
            target.setValueMeasure(measureType);
        }
    }
}
Also used : MeasureType(un.unece.uncefact.data.standard.unqualifieddatatype._20.MeasureType) BigDecimal(java.math.BigDecimal)

Example 9 with FLUXCharacteristic

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

the class ActivityEntityToModelMapper method mapValueIndicator.

private void mapValueIndicator(FLUXCharacteristic target, FluxCharacteristicEntity source) {
    if (ObjectUtils.allNotNull(target, source)) {
        String valueIndicator = source.getValueIndicator();
        if (StringUtils.isNotEmpty(valueIndicator)) {
            IndicatorType type = new IndicatorType();
            IndicatorType.IndicatorString indicatorString = new IndicatorType.IndicatorString();
            indicatorString.setValue(valueIndicator);
            type.setIndicatorString(indicatorString);
            target.setValueIndicator(type);
        }
    }
}
Also used : IndicatorType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IndicatorType)

Example 10 with FLUXCharacteristic

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

the class ActivityEntityToModelMapper method mapSpecifiedFLUXCharacteristics.

private void mapSpecifiedFLUXCharacteristics(FishingActivity fishingActivity, Set<FluxCharacteristicEntity> fluxCharacteristics) {
    if (CollectionUtils.isNotEmpty(fluxCharacteristics)) {
        List<FLUXCharacteristic> fluxCharacteristicList = new ArrayList<>();
        for (FluxCharacteristicEntity source : fluxCharacteristics) {
            FLUXCharacteristic target = new FLUXCharacteristic();
            mapPurposeCode(target, source);
            mapValueCode(target, source);
            mapValueDateTime(target, source);
            mapValueIndicator(target, source);
            mapValueQuantity(target, source);
            mapValueMeasure(target, source);
            mapDescriptions(target, source);
            mapValues(target, source);
            fluxCharacteristicList.add(target);
        }
        fishingActivity.setSpecifiedFLUXCharacteristics(fluxCharacteristicList);
    }
}
Also used : ArrayList(java.util.ArrayList) FLUXCharacteristic(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXCharacteristic) FluxCharacteristicEntity(eu.europa.ec.fisheries.ers.fa.entities.FluxCharacteristicEntity)

Aggregations

FLUXCharacteristic (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXCharacteristic)8 CodeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)6 FluxCharacteristicEntity (eu.europa.ec.fisheries.ers.fa.entities.FluxCharacteristicEntity)4 FLUXLocation (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLUXLocation)4 MeasureType (un.unece.uncefact.data.standard.unqualifieddatatype._20.MeasureType)4 QuantityType (un.unece.uncefact.data.standard.unqualifieddatatype._20.QuantityType)4 TextType (un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType)4 DateTimeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType)3 BigDecimal (java.math.BigDecimal)2 HashSet (java.util.HashSet)2 FACatch (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FACatch)2 FLAPDocument (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLAPDocument)2 FishingGear (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingGear)2 FishingTrip (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FishingTrip)2 IDType (un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType)2 IndicatorType (un.unece.uncefact.data.standard.unqualifieddatatype._20.IndicatorType)2 ArrayList (java.util.ArrayList)1 Date (java.util.Date)1 Test (org.junit.Test)1 AAPProcess (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.AAPProcess)1