[Graph DUMP] Fix issue for empty origilaId list

This commit is contained in:
Miriam Baglioni 2021-11-08 10:25:28 +01:00
parent 8442efd8d1
commit 94918a673c
1 changed files with 15 additions and 3 deletions

View File

@ -133,9 +133,21 @@ public class ResultMapper implements Serializable {
.ifPresent(value -> value.stream().forEach(f -> formatList.add(f.getValue())));
out.setFormat(formatList);
out.setId(input.getId());
out
.setOriginalId(
input.getOriginalId().stream().filter(s -> !s.startsWith("50|")).collect(Collectors.toList()));
out.setOriginalId(new ArrayList<>());
Optional
.ofNullable(input.getOriginalId())
.ifPresent(
v -> out
.setOriginalId(
input
.getOriginalId()
.stream()
.filter(s -> !s.startsWith("50|"))
.collect(Collectors.toList())));
// Optional
// .ofNullable(
// input.getOriginalId().stream().filter(s -> !s.startsWith("50|")).collect(Collectors.toList()))
// .ifPresent(v -> out.setOriginalId(v));
Optional<List<eu.dnetlib.dhp.schema.oaf.Instance>> oInst = Optional
.ofNullable(input.getInstance());