1 | |
package org.kuali.student.r2.common.criteria.transform; |
2 | |
|
3 | |
import java.util.ArrayList; |
4 | |
import java.util.List; |
5 | |
import org.kuali.rice.core.api.criteria.LookupCustomizer; |
6 | |
import org.kuali.rice.core.api.criteria.LookupCustomizer.Transform; |
7 | |
import org.kuali.rice.core.api.criteria.Predicate; |
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | 0 | public class MultiplePredicateTransform implements LookupCustomizer.Transform<Predicate,Predicate>{ |
14 | |
|
15 | |
|
16 | 0 | private List<LookupCustomizer.Transform<Predicate,Predicate>> transforms = |
17 | |
new ArrayList<LookupCustomizer.Transform<Predicate,Predicate>> (); |
18 | |
|
19 | 0 | public MultiplePredicateTransform() { |
20 | 0 | } |
21 | |
|
22 | |
|
23 | |
|
24 | |
|
25 | |
|
26 | 0 | public MultiplePredicateTransform(List<LookupCustomizer.Transform<Predicate,Predicate>> transforms) { |
27 | 0 | this.transforms = transforms; |
28 | 0 | } |
29 | |
|
30 | |
public List<Transform<Predicate, Predicate>> getTransforms() { |
31 | 0 | return transforms; |
32 | |
} |
33 | |
|
34 | |
public void setTransforms(List<Transform<Predicate, Predicate>> transforms) { |
35 | 0 | this.transforms = transforms; |
36 | 0 | } |
37 | |
|
38 | |
@Override |
39 | |
public Predicate apply(Predicate p) { |
40 | 0 | for (Transform<Predicate,Predicate> transform : transforms) { |
41 | 0 | p = transform.apply(p); |
42 | |
} |
43 | 0 | return p; |
44 | |
} |
45 | |
|
46 | |
|
47 | |
|
48 | |
|
49 | |
|
50 | |
|
51 | |
} |