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