View Javadoc

1   /**
2    * Copyright 2010 The Kuali Foundation Licensed under the
3    * Educational Community License, Version 2.0 (the "License"); you may
4    * not use this file except in compliance with the License. You may
5    * obtain a copy of the License at
6    *
7    * http://www.osedu.org/licenses/ECL-2.0
8    *
9    * Unless required by applicable law or agreed to in writing,
10   * software distributed under the License is distributed on an "AS IS"
11   * BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
12   * or implied. See the License for the specific language governing
13   * permissions and limitations under the License.
14   */
15  
16  package org.kuali.student.r2.lum.clu.dto;
17  
18  
19  import org.kuali.student.r2.core.search.dto.SearchParamInfo;
20  import org.kuali.student.r2.core.search.infc.SearchParam;
21  import org.kuali.student.r2.lum.clu.infc.MembershipQuery;
22  
23  import javax.xml.bind.annotation.*;
24  import java.io.Serializable;
25  import java.util.ArrayList;
26  import java.util.List;
27  
28  @XmlAccessorType(XmlAccessType.FIELD)
29  @XmlType(name = "MembershipQueryInfo", propOrder = {"id", "searchTypeKey", "queryParamValues" , "_futureElements" }) 
30  public class MembershipQueryInfo implements Serializable, MembershipQuery {
31  
32      private static final long serialVersionUID = 1L;
33  
34      @XmlAttribute
35      private String id;
36  
37      @XmlElement
38      private String searchTypeKey;
39  
40      @XmlElement
41      private List<SearchParamInfo> queryParamValues;
42  
43      @XmlAnyElement
44      private List<Object> _futureElements;
45  
46      public MembershipQueryInfo() {
47  
48      }
49  
50      public MembershipQueryInfo(MembershipQuery membershipQuery) {
51          if (null != membershipQuery) {
52              this.id = membershipQuery.getId();
53              this.searchTypeKey = membershipQuery.getSearchTypeKey();
54              this.queryParamValues = new ArrayList<SearchParamInfo>();
55              for (SearchParam searchParam : membershipQuery.getQueryParamValues()) {
56                  this.queryParamValues.add(new SearchParamInfo(searchParam));
57              }
58          }
59      }
60  
61      @Override
62      public String getId() {
63          return id;
64      }
65  
66      public void setId(String id) {
67          this.id = id;
68      }
69  
70      @Override
71      public String getSearchTypeKey() {
72          return searchTypeKey;
73      }
74  
75      public void setSearchTypeKey(String searchTypeKey) {
76          this.searchTypeKey = searchTypeKey;
77      }
78  
79      @Override
80      public List<SearchParamInfo> getQueryParamValues() {
81          if (queryParamValues == null) {
82              queryParamValues = new ArrayList<SearchParamInfo>(0);
83          }
84          return queryParamValues;
85      }
86      
87      public void setQueryParamValues(List<SearchParamInfo> queryParamValues) {
88          this.queryParamValues = queryParamValues;
89      }
90  }