1
|
package eu.dnetlib.pace.condition;
|
2
|
|
3
|
import java.util.List;
|
4
|
|
5
|
import eu.dnetlib.pace.model.Field;
|
6
|
import eu.dnetlib.pace.model.FieldDef;
|
7
|
|
8
|
/**
|
9
|
* The Class ExactMatch.
|
10
|
*
|
11
|
* @author claudio
|
12
|
*/
|
13
|
public class ExactMatch extends AbstractCondition {
|
14
|
|
15
|
public ExactMatch(final List<FieldDef> fields) {
|
16
|
super(fields);
|
17
|
}
|
18
|
|
19
|
@Override
|
20
|
protected int verify(final FieldDef fd, final Field a, final Field b) {
|
21
|
|
22
|
final String fa = getValue(a);
|
23
|
final String fb = getValue(b);
|
24
|
|
25
|
return fa.equals(fb) ? 1 : -1;
|
26
|
}
|
27
|
|
28
|
protected String getValue(final Field f) {
|
29
|
return getFirstValue(f);
|
30
|
}
|
31
|
|
32
|
}
|