use of org.folio.rest.acq.model.ReferenceNumberItem in project mod-gobi by folio-org.
the class Mapper method mapVendorDetail.
private void mapVendorDetail(List<CompletableFuture<?>> futures, VendorDetail vendorDetail, Document doc) {
Optional.ofNullable(mappings.get(Mapping.Field.VENDOR_INSTRUCTIONS)).ifPresent(field -> futures.add(field.resolve(doc).thenAccept(o -> vendorDetail.setInstructions((String) o)).exceptionally(Mapper::logException)));
Optional.ofNullable(mappings.get(Mapping.Field.NOTE_FROM_VENDOR)).ifPresent(field -> futures.add(field.resolve(doc).thenAccept(o -> vendorDetail.setNoteFromVendor((String) o)).exceptionally(Mapper::logException)));
ReferenceNumberItem referenceNumber = new ReferenceNumberItem().withVendorDetailsSource(ReferenceNumberItem.VendorDetailsSource.ORDER_LINE);
mapRefTypeNumberPair(futures, referenceNumber, doc);
setObjectIfPresent(referenceNumber, o -> {
List<ReferenceNumberItem> referenceNumbers = new ArrayList<>();
referenceNumbers.add(referenceNumber);
vendorDetail.setReferenceNumbers(referenceNumbers);
});
Optional.ofNullable(mappings.get(Mapping.Field.VENDOR_ACCOUNT)).ifPresent(field -> futures.add(field.resolve(doc).thenAccept(o -> vendorDetail.setVendorAccount((String) o)).exceptionally(Mapper::logException)));
}
Aggregations