1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
|
12 | |
|
13 | |
|
14 | |
|
15 | |
|
16 | |
|
17 | |
package org.kuali.student.r2.common.dto; |
18 | |
|
19 | |
import java.io.Serializable; |
20 | |
import java.util.ArrayList; |
21 | |
import java.util.Collections; |
22 | |
import java.util.List; |
23 | |
|
24 | |
import javax.xml.bind.annotation.XmlAccessType; |
25 | |
import javax.xml.bind.annotation.XmlAccessorType; |
26 | |
import javax.xml.bind.annotation.XmlAnyElement; |
27 | |
import javax.xml.bind.annotation.XmlElement; |
28 | |
import javax.xml.bind.annotation.XmlElementWrapper; |
29 | |
import javax.xml.bind.annotation.XmlType; |
30 | |
|
31 | |
import org.kuali.student.r2.common.infc.Comparison; |
32 | |
import org.kuali.student.r2.common.infc.Criteria; |
33 | |
import org.w3c.dom.Element; |
34 | |
|
35 | |
|
36 | |
|
37 | |
|
38 | |
|
39 | |
|
40 | |
|
41 | |
|
42 | |
|
43 | |
@XmlAccessorType(XmlAccessType.FIELD) |
44 | |
@XmlType(name = "CriteriaInfo", propOrder = { |
45 | |
"comparisons", "maxResults", |
46 | |
"_futureElements" }) |
47 | |
|
48 | |
public class CriteriaInfo |
49 | |
implements Criteria, Serializable { |
50 | |
|
51 | |
private static final long serialVersionUID = 1L; |
52 | |
|
53 | |
@XmlElementWrapper(name = "comparisons") |
54 | |
@XmlElement(name = "comparison") |
55 | |
private List<ComparisonInfo> comparisons; |
56 | |
|
57 | |
@XmlElement |
58 | |
private Integer maxResults; |
59 | |
|
60 | |
@XmlAnyElement |
61 | |
private List<Element> _futureElements; |
62 | |
|
63 | |
|
64 | |
|
65 | |
|
66 | |
|
67 | 0 | public CriteriaInfo() { |
68 | 0 | } |
69 | |
|
70 | |
|
71 | |
|
72 | |
|
73 | |
|
74 | |
|
75 | 0 | public CriteriaInfo(Criteria criteria) { |
76 | 0 | if (criteria != null) { |
77 | 0 | if (criteria.getComparisons() != null) { |
78 | 0 | this.comparisons = new ArrayList<ComparisonInfo>(); |
79 | 0 | for (Comparison comparison : criteria.getComparisons()) { |
80 | 0 | this.comparisons.add(new ComparisonInfo(comparison)); |
81 | |
} |
82 | |
} |
83 | 0 | this.maxResults = criteria.getMaxResults(); |
84 | |
} |
85 | 0 | } |
86 | |
|
87 | |
@Override |
88 | |
public List<? extends Comparison> getComparisons() { |
89 | 0 | if (comparisons == null) { |
90 | 0 | comparisons = new ArrayList<ComparisonInfo>(0); |
91 | |
} |
92 | |
|
93 | 0 | return this.comparisons; |
94 | |
} |
95 | |
|
96 | |
public void setComparisons(List<ComparisonInfo> comparisons) { |
97 | 0 | this.comparisons = comparisons; |
98 | 0 | } |
99 | |
|
100 | |
@Override |
101 | |
public Integer getMaxResults() { |
102 | 0 | return this.maxResults; |
103 | |
} |
104 | |
|
105 | |
public void setMaxResults(Integer maxResults) { |
106 | 0 | this.maxResults = maxResults; |
107 | 0 | } |
108 | |
} |