1
0
Fork 0

[Cleaning] drop alternate identifiers with empty values

This commit is contained in:
Claudio Atzori 2021-03-29 16:01:35 +02:00
parent a0837ac357
commit 3becaa5539
1 changed files with 2 additions and 0 deletions

View File

@ -155,12 +155,14 @@ public class CleaningFunctions {
final Set<StructuredProperty> pids = final Set<StructuredProperty> pids =
pid pid
.stream() .stream()
.filter(Objects::nonNull)
.filter(p -> StringUtils.isNotBlank(p.getValue())) .filter(p -> StringUtils.isNotBlank(p.getValue()))
.collect(Collectors.toCollection(HashSet::new)); .collect(Collectors.toCollection(HashSet::new));
Optional.ofNullable(i.getAlternateIdentifier()) Optional.ofNullable(i.getAlternateIdentifier())
.ifPresent(altId -> { .ifPresent(altId -> {
final Set<StructuredProperty> altIds = altId.stream() final Set<StructuredProperty> altIds = altId.stream()
.filter(Objects::nonNull)
.filter(p -> StringUtils.isNotBlank(p.getValue())) .filter(p -> StringUtils.isNotBlank(p.getValue()))
.collect(Collectors.toCollection(HashSet::new)); .collect(Collectors.toCollection(HashSet::new));