From c6a7602b3eeaee3f66fa9ff575408c963287d4a0 Mon Sep 17 00:00:00 2001 From: "miriam.baglioni" Date: Thu, 6 Apr 2023 14:45:01 +0200 Subject: [PATCH] refactoring after compilation --- .../eu/dnetlib/dhp/common/MakeTarArchive.java | 7 +++- .../dhp/bulktag/community/Community.java | 2 +- .../dhp/bulktag/community/ResultTagger.java | 2 +- .../criteria/StartsWithIgnoreCaseVerb.java | 34 ++++++++-------- .../dhp/bulktag/criteria/StartsWithVerb.java | 39 ++++++++----------- 5 files changed, 41 insertions(+), 43 deletions(-) diff --git a/dhp-common/src/main/java/eu/dnetlib/dhp/common/MakeTarArchive.java b/dhp-common/src/main/java/eu/dnetlib/dhp/common/MakeTarArchive.java index e1c79091b..43e61e5fc 100644 --- a/dhp-common/src/main/java/eu/dnetlib/dhp/common/MakeTarArchive.java +++ b/dhp-common/src/main/java/eu/dnetlib/dhp/common/MakeTarArchive.java @@ -58,9 +58,12 @@ public class MakeTarArchive implements Serializable { makeTArArchive(fileSystem, inputPath, outputPath, gBperSplit, rename); } - public static void makeTArArchive(FileSystem fileSystem, String inputPath, String outputPath, int gBperSplit) throws IOException{ - makeTArArchive(fileSystem,inputPath,outputPath,gBperSplit,false); + + public static void makeTArArchive(FileSystem fileSystem, String inputPath, String outputPath, int gBperSplit) + throws IOException { + makeTArArchive(fileSystem, inputPath, outputPath, gBperSplit, false); } + public static void makeTArArchive(FileSystem fileSystem, String inputPath, String outputPath, int gBperSplit, boolean rename) throws IOException { diff --git a/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/community/Community.java b/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/community/Community.java index 9d039a7ac..c218b0c2b 100644 --- a/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/community/Community.java +++ b/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/community/Community.java @@ -25,7 +25,7 @@ public class Community implements Serializable { return !getSubjects().isEmpty() || !getProviders().isEmpty() || !getZenodoCommunities().isEmpty() - || getConstraints().getCriteria() != null; + || getConstraints().getCriteria() != null; } public String getId() { diff --git a/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/community/ResultTagger.java b/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/community/ResultTagger.java index 4a764acd7..aa59326b6 100644 --- a/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/community/ResultTagger.java +++ b/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/community/ResultTagger.java @@ -139,7 +139,7 @@ public class ResultTagger implements Serializable { .getSelectionConstraintsMap() .keySet() .forEach(communityId -> { - if (conf.getSelectionConstraintsMap().get(communityId) != null && + if (conf.getSelectionConstraintsMap().get(communityId).getCriteria() != null && conf .getSelectionConstraintsMap() .get(communityId) diff --git a/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/criteria/StartsWithIgnoreCaseVerb.java b/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/criteria/StartsWithIgnoreCaseVerb.java index 6dbe3d551..776bcb350 100644 --- a/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/criteria/StartsWithIgnoreCaseVerb.java +++ b/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/criteria/StartsWithIgnoreCaseVerb.java @@ -1,8 +1,8 @@ + package eu.dnetlib.dhp.bulktag.criteria; import java.io.Serializable; - /** * @author miriam.baglioni * @Date 06/04/23 @@ -10,25 +10,25 @@ import java.io.Serializable; @VerbClass("starts_with_caseinsensitive") public class StartsWithIgnoreCaseVerb implements Selection, Serializable { - private String param; + private String param; - public StartsWithIgnoreCaseVerb() { - } + public StartsWithIgnoreCaseVerb() { + } - public StartsWithIgnoreCaseVerb(final String param) { - this.param = param; - } + public StartsWithIgnoreCaseVerb(final String param) { + this.param = param; + } - @Override - public boolean apply(String value) { - return value.toLowerCase().startsWith(param.toLowerCase()); - } + @Override + public boolean apply(String value) { + return value.toLowerCase().startsWith(param.toLowerCase()); + } - public String getParam() { - return param; - } + public String getParam() { + return param; + } - public void setParam(String param) { - this.param = param; - } + public void setParam(String param) { + this.param = param; + } } diff --git a/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/criteria/StartsWithVerb.java b/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/criteria/StartsWithVerb.java index eee683d6e..ff8118e62 100644 --- a/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/criteria/StartsWithVerb.java +++ b/dhp-workflows/dhp-enrichment/src/main/java/eu/dnetlib/dhp/bulktag/criteria/StartsWithVerb.java @@ -1,3 +1,4 @@ + package eu.dnetlib.dhp.bulktag.criteria; import java.io.Serializable; @@ -9,31 +10,25 @@ import java.io.Serializable; @VerbClass("starts_with") public class StartsWithVerb implements Selection, Serializable { - private String param; + private String param; - public StartsWithVerb() { - } + public StartsWithVerb() { + } - public StartsWithVerb(final String param) { - this.param = param; - } + public StartsWithVerb(final String param) { + this.param = param; + } - @Override - public boolean apply(String value) { - return value.startsWith(param); - } + @Override + public boolean apply(String value) { + return value.startsWith(param); + } - public String getParam() { - return param; - } + public String getParam() { + return param; + } - public void setParam(String param) { - this.param = param; - } + public void setParam(String param) { + this.param = param; + } } - - - - - -