Search in sources :

Example 6 with RegistrationLocation

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

the class ActivityEntityToModelMapper method mapCountryID.

private void mapCountryID(RegistrationLocation target, RegistrationLocationEntity source) {
    if (ObjectUtils.allNotNull(target, source)) {
        IDType idType = new IDType();
        idType.setSchemeID(source.getLocationCountrySchemeId());
        idType.setValue(source.getLocationCountryId());
        target.setCountryID(idType);
    }
}
Also used : IDType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType)

Example 7 with RegistrationLocation

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

the class ActivityEntityToModelMapper method setDescriptions.

private void setDescriptions(RegistrationLocation target, RegistrationLocationEntity source) {
    if (ObjectUtils.allNotNull(target, source)) {
        TextType textType = new TextType();
        textType.setValue(source.getDescription());
        textType.setLanguageID(source.getDescLanguageId());
        target.setDescriptions(singletonList(textType));
    }
}
Also used : TextType(un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType)

Example 8 with RegistrationLocation

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

the class RegistrationLocationMapperTest method testRegistrationLocationMapper.

@Test
public void testRegistrationLocationMapper() {
    RegistrationLocation registrationLocation = MapperUtil.getRegistrationLocation();
    RegistrationLocationEntity registrationLocationEntity = RegistrationLocationMapper.INSTANCE.mapToRegistrationLocationEntity(registrationLocation);
    assertTrue(registrationLocationEntity.getDescription().startsWith(registrationLocation.getDescriptions().get(0).getValue()));
    assertTrue(registrationLocationEntity.getName().startsWith(registrationLocation.getNames().get(0).getValue()));
    assertEquals(registrationLocation.getGeopoliticalRegionCode().getValue(), registrationLocationEntity.getRegionCode());
    assertEquals(registrationLocation.getGeopoliticalRegionCode().getListID(), registrationLocationEntity.getRegionCodeListId());
    assertEquals(registrationLocation.getCountryID().getValue(), registrationLocationEntity.getLocationCountryId());
    assertEquals(registrationLocation.getCountryID().getSchemeID(), registrationLocationEntity.getLocationCountrySchemeId());
    assertEquals(registrationLocation.getTypeCode().getValue(), registrationLocationEntity.getTypeCode());
    assertEquals(registrationLocation.getTypeCode().getListID(), registrationLocationEntity.getTypeCodeListId());
    assertNull(registrationLocationEntity.getRegistrationEvent());
}
Also used : RegistrationLocationEntity(eu.europa.ec.fisheries.ers.fa.entities.RegistrationLocationEntity) RegistrationLocation(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.RegistrationLocation) Test(org.junit.Test)

Example 9 with RegistrationLocation

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

the class MapperUtil method getRegistrationLocation.

public static RegistrationLocation getRegistrationLocation() {
    IDType countryID = getIdType("XEU", "TERRITORY");
    List<TextType> descriptions = Arrays.asList(getTextType("This is Test Text"));
    CodeType geopoliticalRegionCode = getCodeType("Region Code 1", "57tug6-tfu576-5tud75-t57e5td-56tdwe");
    List<IDType> ids = Arrays.asList(getIdType("ID 2", "fhtyr8-45jrf-5784fhrt-thf75"));
    List<TextType> names = Arrays.asList(getTextType("This is Test Name"));
    CodeType typeCode = getCodeType("Code type 1", "475rhf-587trhdy-thgy576-thfr64");
    RegistrationLocation registrationLocation = new RegistrationLocation(countryID, descriptions, geopoliticalRegionCode, ids, names, typeCode, null);
    return registrationLocation;
}
Also used : RegistrationLocation(un.unece.uncefact.data.standard.reusableaggregatebusinessinformationentity._20.RegistrationLocation) CodeType(un.unece.uncefact.data.standard.unqualifieddatatype._20.CodeType) IDType(un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType) TextType(un.unece.uncefact.data.standard.unqualifieddatatype._20.TextType)

Aggregations

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