1
|
package eu.dnetlib.domain.enabling;
|
2
|
|
3
|
import java.util.ArrayList;
|
4
|
import java.util.List;
|
5
|
|
6
|
import eu.dnetlib.domain.SearchCriteria;
|
7
|
import eu.dnetlib.domain.SearchCriteriaImpl;
|
8
|
|
9
|
public class SecurityProfileSearchCriteria extends SearchCriteriaImpl implements
|
10
|
SearchCriteria {
|
11
|
|
12
|
private List<String> driverResourceIds = new ArrayList<String>();
|
13
|
|
14
|
public boolean matches(Object o) {
|
15
|
if (!(o instanceof SecurityProfile)) {
|
16
|
return false;
|
17
|
}
|
18
|
|
19
|
SecurityProfile profile = (SecurityProfile) o;
|
20
|
|
21
|
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
|
}
|
30
|
|
31
|
return true;
|
32
|
}
|
33
|
|
34
|
public List<String> getDriverResourceIds() {
|
35
|
return driverResourceIds;
|
36
|
}
|
37
|
|
38
|
public void setDriverResourceIds(List<String> driverResourceIds) {
|
39
|
this.driverResourceIds = driverResourceIds;
|
40
|
}
|
41
|
}
|