added the ignore case for both the constraints

This commit is contained in:
Miriam Baglioni 2020-11-18 11:56:40 +01:00
parent ec5b5c3a23
commit 457c07a522
2 changed files with 8 additions and 2 deletions

View File

@ -17,7 +17,7 @@ public class ContainsConstraint implements Selection, Serializable {
@Override @Override
public boolean apply(String value) { public boolean apply(String value) {
return value.contains(param); return value.contains(param.toLowerCase());
} }
public String getParam() { public String getParam() {

View File

@ -3,6 +3,10 @@ package eu.dnetlib.dhp.oa.graph.clean.authorpids.constraints;
import java.io.Serializable; import java.io.Serializable;
import org.apache.commons.lang3.StringUtils;
import py4j.StringUtil;
@ConstraintClass("equals") @ConstraintClass("equals")
public class EqualConstraint implements Selection, Serializable { public class EqualConstraint implements Selection, Serializable {
@ -17,7 +21,9 @@ public class EqualConstraint implements Selection, Serializable {
@Override @Override
public boolean apply(String value) { public boolean apply(String value) {
return value.equals(param); if (StringUtils.isEmpty(value))
return false;
return value.equalsIgnoreCase(param);
} }
public String getParam() { public String getParam() {