1 |
1218
|
antonis.le
|
package eu.dnetlib.domain.enabling;
|
2 |
|
|
|
3 |
5960
|
antonis.le
|
import java.util.ArrayList;
|
4 |
|
|
import java.util.List;
|
5 |
|
|
|
6 |
1218
|
antonis.le
|
import eu.dnetlib.domain.SearchCriteria;
|
7 |
|
|
import eu.dnetlib.domain.SearchCriteriaImpl;
|
8 |
|
|
|
9 |
3983
|
antonis.le
|
public class SecurityProfileSearchCriteria extends SearchCriteriaImpl implements
|
10 |
|
|
SearchCriteria {
|
11 |
|
|
|
12 |
5960
|
antonis.le
|
private List<String> driverResourceIds = new ArrayList<String>();
|
13 |
1218
|
antonis.le
|
|
14 |
|
|
public boolean matches(Object o) {
|
15 |
3983
|
antonis.le
|
if (!(o instanceof SecurityProfile)) {
|
16 |
1218
|
antonis.le
|
return false;
|
17 |
|
|
}
|
18 |
3983
|
antonis.le
|
|
19 |
1218
|
antonis.le
|
SecurityProfile profile = (SecurityProfile) o;
|
20 |
3983
|
antonis.le
|
|
21 |
5960
|
antonis.le
|
if (driverResourceIds != null) {
|
22 |
|
|
for (String driverResourceId : driverResourceIds)
|
23 |
|
|
if (driverResourceId != null) {
|
24 |
|
|
if (profile.getDriverResourceId() == null
|
25 |
|
|
|| !profile.getDriverResourceId().equals(
|
26 |
|
|
driverResourceId))
|
27 |
|
|
return false;
|
28 |
|
|
}
|
29 |
1218
|
antonis.le
|
}
|
30 |
3983
|
antonis.le
|
|
31 |
1218
|
antonis.le
|
return true;
|
32 |
|
|
}
|
33 |
5960
|
antonis.le
|
|
34 |
|
|
public List<String> getDriverResourceIds() {
|
35 |
|
|
return driverResourceIds;
|
36 |
|
|
}
|
37 |
|
|
|
38 |
|
|
public void setDriverResourceIds(List<String> driverResourceIds) {
|
39 |
|
|
this.driverResourceIds = driverResourceIds;
|
40 |
|
|
}
|
41 |
1218
|
antonis.le
|
}
|