use of un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType in project UVMS-ActivityModule-APP by UnionVMS.
the class MapperUtil method getIdType.
public static IDType getIdType(String type, String schemeId) {
IDType idType = new IDType();
idType.setValue(type);
idType.setSchemeID(schemeId);
return idType;
}
use of un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType in project UVMS-ActivityModule-APP by UnionVMS.
the class FluxMessageServiceBeanTest method setUp.
@Before
public void setUp() {
FAReportDocument faReportDocument2 = MapperUtil.getFaReportDocument();
faReportDocument2.getRelatedFLUXReportDocument().setPurposeCode(MapperUtil.getCodeType("9", "4fyrh-58fj4-5jtu-58tjr"));
IDType id = faReportDocument2.getRelatedFLUXReportDocument().getReferencedID();
FAReportDocument faReportDocument1 = MapperUtil.getFaReportDocument();
faReportDocument1.getRelatedFLUXReportDocument().setIDS(Arrays.asList(id));
faReportDocument1.getRelatedFLUXReportDocument().setPurposeCode(MapperUtil.getCodeType("3", "4f5yrh-58f7j4-5j5tu-58tj7r"));
fluxFaReportMessage = new FLUXFAReportMessage();
faReportDocuments = Arrays.asList(faReportDocument1, faReportDocument2);
fluxFaReportMessage.setFAReportDocuments(faReportDocuments);
fluxFaReportMessage.setFLUXReportDocument(MapperUtil.getFluxReportDocument());
}
use of un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType in project UVMS-ActivityModule-APP by UnionVMS.
the class FaReportDocumentMapper method getFluxReportDocument.
protected FluxReportDocumentEntity getFluxReportDocument(FLUXReportDocument fluxReportDocument, FaReportDocumentEntity faReportDocumentEntity) {
if (fluxReportDocument == null) {
return null;
}
FluxReportDocumentEntity fluxReportDocumentEntity = FluxReportDocumentMapper.INSTANCE.mapToFluxReportDocumentEntity(fluxReportDocument);
if (fluxReportDocument.getOwnerFLUXParty() != null) {
FluxPartyEntity fluxPartyEntity = FluxPartyMapper.INSTANCE.mapToFluxPartyEntity(fluxReportDocument.getOwnerFLUXParty());
fluxPartyEntity.setFluxReportDocument(fluxReportDocumentEntity);
fluxReportDocumentEntity.setFluxParty(fluxPartyEntity);
}
Set<FluxReportIdentifierEntity> reportIdentifierEntitySet = new HashSet<>();
if (CollectionUtils.isNotEmpty(fluxReportDocument.getIDS())) {
for (IDType idType : fluxReportDocument.getIDS()) {
FluxReportIdentifierEntity fluxReportIdentifierEntity = FluxReportIdentifierMapper.INSTANCE.mapToFluxReportIdentifierEntity(idType);
fluxReportIdentifierEntity.setFluxReportDocument(fluxReportDocumentEntity);
reportIdentifierEntitySet.add(fluxReportIdentifierEntity);
}
}
fluxReportDocumentEntity.setFluxReportIdentifiers(reportIdentifierEntitySet);
fluxReportDocumentEntity.setFaReportDocument(faReportDocumentEntity);
return fluxReportDocumentEntity;
}
use of un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEntityToModelMapper method mapID.
private void mapID(VesselStorageCharacteristic target, VesselStorageCharacteristicsEntity source) {
if (ObjectUtils.allNotNull(target, source)) {
IDType idType = new IDType();
idType.setSchemeID(source.getVesselSchemaId());
idType.setValue(source.getVesselId());
target.setID(idType);
}
}
use of un.unece.uncefact.data.standard.unqualifieddatatype._20.IDType in project UVMS-ActivityModule-APP by UnionVMS.
the class ActivityEntityToModelMapper method mapRelatedReportIDs.
private void mapRelatedReportIDs(FAReportDocument target, Set<FaReportIdentifierEntity> faReportIdentifiers) {
if (CollectionUtils.isNotEmpty(faReportIdentifiers)) {
List<IDType> idTypeList = new ArrayList<>();
for (FaReportIdentifierEntity source : faReportIdentifiers) {
IDType idType = new IDType();
String faReportIdentifierId = source.getFaReportIdentifierId();
String faReportIdentifierSchemeId = source.getFaReportIdentifierSchemeId();
idType.setSchemeID(faReportIdentifierSchemeId);
idType.setValue(faReportIdentifierId);
idTypeList.add(idType);
}
target.setRelatedReportIDs(idTypeList);
}
}
Aggregations