[Cleaning] drop alternate identifiers with empty values

pull/104/head
Claudio Atzori 3 years ago
parent 827e7e37db
commit b5b7dc2104

@ -152,7 +152,12 @@ public class CleaningFunctions {
Optional
.ofNullable(i.getPid())
.ifPresent(pid -> {
final Set<StructuredProperty> pids = Sets.newHashSet(pid);
final Set<StructuredProperty> pids = Sets
.newHashSet(
pid
.stream()
.filter(p -> StringUtils.isBlank(p.getValue()))
.collect(Collectors.toList()));
final Set<StructuredProperty> altIds = Sets.newHashSet(i.getAlternateIdentifier());
i.setAlternateIdentifier(Lists.newArrayList(Sets.difference(altIds, pids)));
});

Loading…
Cancel
Save