1
2
3
4
5
6
7
8
9
10
11
12
13
14
15 package org.kuali.mobility.people.entity;
16
17 import java.util.ArrayList;
18 import java.util.List;
19 import javax.xml.bind.annotation.XmlElement;
20 import javax.xml.bind.annotation.XmlRootElement;
21 import org.apache.commons.collections.CollectionUtils;
22 import org.kuali.mobility.people.service.util.GroupTransform;
23 import org.kuali.mobility.people.service.util.PersonTransform;
24
25
26
27
28
29
30 @XmlRootElement(name="searchResults")
31 public class SearchResultImpl implements SearchResult {
32
33
34
35
36 private String error;
37
38
39
40
41 private SearchCriteria searchCriteria;
42
43
44
45
46
47 @XmlElement(name="people")
48 private List<PersonImpl> people;
49
50
51
52
53
54 @XmlElement(name="groups")
55 private List<GroupImpl> groups;
56
57
58
59
60
61 public SearchResultImpl() {
62 people = new ArrayList<PersonImpl>();
63 groups = new ArrayList<GroupImpl>();
64 }
65
66
67
68
69
70 @Override
71 public String getError() {
72 return error;
73 }
74
75
76
77
78
79 @Override
80 public void setError(String error) {
81 this.error = error;
82 }
83
84
85
86
87
88 @Override
89 public List<PersonImpl> getPeople() {
90 return people;
91 }
92
93
94
95
96
97 @Override
98 public void setPeople(List<? extends Person> people) {
99 CollectionUtils.collect( people, new PersonTransform(), this.people );
100 }
101
102
103
104
105
106 @Override
107 public List<GroupImpl> getGroups() {
108 return groups;
109 }
110
111
112
113
114
115 @Override
116 public void setGroups(List<? extends Group> groups) {
117 CollectionUtils.collect( groups, new GroupTransform(), this.groups );
118 }
119
120
121
122
123
124 public SearchCriteria getSearchCriteria() {
125 return searchCriteria;
126 }
127
128
129
130
131
132 public void setSearchCriteria(SearchCriteria searchCriteria) {
133 this.searchCriteria = searchCriteria;
134 }
135 }