use of un.unece.uncefact.data.standard.unqualifieddatatype._100.TextType in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEntityToModelMapper method mapDescriptions.
private void mapDescriptions(FLUXCharacteristic target, FluxCharacteristicEntity source) {
if (ObjectUtils.allNotNull(target, source)) {
String description = source.getDescription();
String valueLanguageId = source.getValueLanguageId();
if (StringUtils.isNotEmpty(description) || StringUtils.isNotEmpty(valueLanguageId)) {
TextType textType = new TextType();
if (StringUtils.isNotEmpty(description)) {
textType.setValue(description);
}
if (StringUtils.isNotEmpty(valueLanguageId)) {
textType.setLanguageID(source.getValueLanguageId());
}
target.setDescriptions(Collections.singletonList(textType));
}
}
}
use of un.unece.uncefact.data.standard.unqualifieddatatype._100.TextType 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));
}
}
use of un.unece.uncefact.data.standard.unqualifieddatatype._100.TextType in project UVMS-ActivityModule-APP by UnionVMS.
the class FluxPartyMapper method mapNamesAndLanguageId.
private void mapNamesAndLanguageId(FLUXParty target, String fluxPartyName, String nameLanguageId) {
if (ObjectUtils.allNotNull(target) && (StringUtils.isNotEmpty(fluxPartyName) || StringUtils.isNotEmpty(nameLanguageId))) {
TextType textType = new TextType();
if (StringUtils.isNotEmpty(fluxPartyName)) {
textType.setValue(fluxPartyName);
}
if (StringUtils.isNotEmpty(nameLanguageId)) {
textType.setLanguageID(fluxPartyName);
}
target.setNames(singletonList(textType));
}
}
use of un.unece.uncefact.data.standard.unqualifieddatatype._100.TextType 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;
}
use of un.unece.uncefact.data.standard.unqualifieddatatype._100.TextType in project UVMS-ActivityModule-APP by UnionVMS.
the class MapperUtil method getFluxLocation.
public static FLUXLocation getFluxLocation() {
FLUXLocation fluxLocation = new FLUXLocation();
CodeType typeCode = getCodeType("AREA", "FLUX_LOCATION_TYPE");
IDType countryID = getIdType("XEU", "TERRITORY");
CodeType regionalFisheriesManagementOrganizationCode = getCodeType("RFMO1", "fhty58-gh586t-5tjf8-t58rjewe");
FLUXGeographicalCoordinate specifiedPhysicalFLUXGeographicalCoordinate = getFluxGeographicalCoordinate();
IDType id = getIdType("25.5b", "FAO_AREA");
CodeType geopoliticalRegionCode = getCodeType("Code type 2", "fhty258-g3h586t-5t4jf8-t58rjew5e");
List<TextType> names = Arrays.asList(getTextType("This is sample name"));
IDType sovereignRightsCountryID = getIdType("sovereign rights id 1", "fhty58-gh5486t-5t5jf8-t58rjewe");
IDType jurisdictionCountryID = getIdType("jurisdiction country id 1", "fht1y58-gh5876t-5t3jf8-t58rjewe");
List<FLUXCharacteristic> applicableFLUXCharacteristics = null;
List<StructuredAddress> postalStructuredAddresses = Arrays.asList(getStructuredAddress());
StructuredAddress physicalStructuredAddress = getStructuredAddress();
fluxLocation.setTypeCode(typeCode);
fluxLocation.setCountryID(countryID);
fluxLocation.setRegionalFisheriesManagementOrganizationCode(regionalFisheriesManagementOrganizationCode);
fluxLocation.setSpecifiedPhysicalFLUXGeographicalCoordinate(specifiedPhysicalFLUXGeographicalCoordinate);
fluxLocation.setID(id);
fluxLocation.setGeopoliticalRegionCode(geopoliticalRegionCode);
fluxLocation.setNames(names);
fluxLocation.setSovereignRightsCountryID(sovereignRightsCountryID);
fluxLocation.setJurisdictionCountryID(jurisdictionCountryID);
fluxLocation.setApplicableFLUXCharacteristics(applicableFLUXCharacteristics);
fluxLocation.setPostalStructuredAddresses(postalStructuredAddresses);
fluxLocation.setPhysicalStructuredAddress(physicalStructuredAddress);
return fluxLocation;
}
Aggregations