Search in sources :

Example 1 with RegistrationEvent

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

the class MapperUtil method getRegistrationEvent.

public static RegistrationEvent getRegistrationEvent() {
    List<TextType> descriptions = Arrays.asList(getTextType("This is test Text"));
    DateTimeType occurrenceDateTime = getDateTimeType("2016-07-01 11:15:00");
    RegistrationLocation relatedRegistrationLocation = getRegistrationLocation();
    RegistrationEvent registrationEvent = new RegistrationEvent(descriptions, occurrenceDateTime, relatedRegistrationLocation);
    return registrationEvent;
}
Also used : RegistrationLocation(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.RegistrationLocation) DateTimeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType) RegistrationEvent(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.RegistrationEvent) TextType(un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType)

Example 2 with RegistrationEvent

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

the class ActivityEntityToModelMapper method mapRelatedRegistrationLocation.

private void mapRelatedRegistrationLocation(RegistrationEvent target, RegistrationLocationEntity source) {
    if (ObjectUtils.allNotNull(target, source)) {
        RegistrationLocation registrationLocation = new RegistrationLocation();
        setDescriptions(registrationLocation, source);
        mapCountryID(registrationLocation, source);
        setGeopoliticalRegionCode(registrationLocation, source);
        mapNames(registrationLocation, source);
        mapPurposeCode(registrationLocation, source);
        target.setRelatedRegistrationLocation(registrationLocation);
    }
}
Also used : RegistrationLocation(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.RegistrationLocation)

Example 3 with RegistrationEvent

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

the class ActivityEntityToModelMapper method mapOccurrenceDateTime.

private void mapOccurrenceDateTime(RegistrationEvent target, Date source) {
    if (ObjectUtils.allNotNull(target, source)) {
        DateTimeType dateTimeType = new DateTimeType();
        dateTimeType.setDateTime(DateUtils.dateToXmlGregorian(source));
        target.setOccurrenceDateTime(dateTimeType);
    }
}
Also used : DateTimeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType)

Example 4 with RegistrationEvent

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

the class ActivityEntityToModelMapper method mapRegistrationEvent.

private void mapRegistrationEvent(VesselTransportMeans target, RegistrationEventEntity source) {
    if (ObjectUtils.allNotNull(target, source)) {
        RegistrationEvent registrationEvent = new RegistrationEvent();
        mapOccurrenceDateTime(registrationEvent, source.getOccurrenceDatetime());
        mapDescription(registrationEvent, source.getDescription(), source.getDescLanguageId());
        mapRelatedRegistrationLocation(registrationEvent, source.getRegistrationLocation());
        target.setSpecifiedRegistrationEvents(singletonList(registrationEvent));
    }
}
Also used : RegistrationEvent(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.RegistrationEvent)

Example 5 with RegistrationEvent

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

the class ActivityEntityToModelMapper method mapDescription.

private void mapDescription(RegistrationEvent target, String description, String descLanguageId) {
    if (ObjectUtils.allNotNull(target) && StringUtils.isNotEmpty(description) || StringUtils.isNotEmpty(descLanguageId)) {
        TextType textType = new TextType();
        if (StringUtils.isNotEmpty(description)) {
            textType.setValue(description);
        }
        if (StringUtils.isNotEmpty(descLanguageId)) {
            textType.setLanguageID(descLanguageId);
        }
        target.setDescriptions(Collections.singletonList(textType));
    }
}
Also used : TextType(un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType)

Aggregations

RegistrationEvent (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.RegistrationEvent)4 TextType (un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType)3 RegistrationLocation (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.RegistrationLocation)2 DateTimeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.DateTimeType)2 RegistrationEventEntity (eu.europa.ec.fisheries.ers.fa.entities.RegistrationEventEntity)1 Test (org.junit.Test)1 ContactParty (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.ContactParty)1 FLAPDocument (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.FLAPDocument)1 VesselCountry (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselCountry)1 VesselTransportMeans (un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.VesselTransportMeans)1 CodeType (un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType)1 IDType (un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType)1