Commit 48f8c86c by Steinberg, Jan

make doabooks filter syntax clearer

parent df398272
......@@ -40,14 +40,14 @@ public class Doabooks2SsoarBundleFilter implements BundleFilter {
Metadatum licence = metadata.stream().filter( m -> m.getKey().equals("dc.dc.rights.licence") ).findFirst().orElse(null);
if (null != clasShorts.stream().filter(cls -> Arrays.asList(valuesToBeFilteredTo).contains(cls.getValue()))
&& null != licence) {
LOG.debug("clasShort-Set not null and a licence entry is found");
LOG.info("clasShort-Set not null and a licence entry is found");
if (clasShorts.stream().filter(cls -> Arrays.asList(valuesToBeFilteredTo).contains(cls.getValue())).count() > 0) {
if (Arrays.asList(licenceStringsToBeFilteredTo).stream().anyMatch( str -> licence.getValue().contains(str))) {
if (Arrays.asList(licenceStringsToBeFilteredTo).stream().filter( str -> licence.getValue().contains(str)).count() > 0) {
result = true;
LOG.debug("We take it: {}", clasShorts.stream().map(Metadatum::getValue).collect(Collectors.joining("; ")));
LOG.info("We take it: {}", clasShorts.stream().map(Metadatum::getValue).collect(Collectors.joining("; ")));
} else {
result = false;
LOG.debug("Filtered away because of licence: {}", licence.getValue());
LOG.info("Filtered away because of licence: {}", licence.getValue());
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment