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  import java.io.Serializable;
19  import java.util.ArrayList;
20  import java.util.Date;
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.XmlType;
28  
29  import org.kuali.student.r2.common.dto.IdEntityInfo;
30  import org.kuali.student.r2.lum.clu.infc.CluSet;
31  
32  @XmlAccessorType(XmlAccessType.FIELD)
33  @XmlType(name = "CluSetInfo", propOrder = {"id", "descr", "stateKey", "typeKey", "name", "membershipQuery", "adminOrg", "isReusable", "isReferenceable", "cluSetIds", "cluIds",
34          "effectiveDate", "expirationDate", "meta", "attributes" , "_futureElements" }) 
35  public class CluSetInfo extends IdEntityInfo implements Serializable, CluSet {
36  
37      private static final long serialVersionUID = 1L;
38  
39      @XmlElement
40      private MembershipQueryInfo membershipQuery;
41  
42      @XmlElement
43      private String adminOrg;
44  
45      @XmlElement
46      private Boolean isReusable;
47  
48      @XmlElement
49      private Boolean isReferenceable;
50  
51      @XmlElement
52      private List<String> cluSetIds;
53  
54      @XmlElement
55      private List<String> cluIds;
56  
57      @XmlElement
58      private Date effectiveDate;
59  
60      @XmlElement
61      private Date expirationDate;
62  
63      @XmlAnyElement
64      private List<Object> _futureElements;  
65  
66      public CluSetInfo() {
67  
68      }
69  
70      public CluSetInfo(CluSet cluSet) {
71          super(cluSet);
72          if (null != cluSet) {
73              this.membershipQuery = (null != cluSet.getMembershipQuery()) ? new MembershipQueryInfo(cluSet.getMembershipQuery()) : null;
74              this.adminOrg = cluSet.getAdminOrg();
75              this.isReusable = cluSet.getIsReusable();
76              this.isReferenceable = cluSet.getIsReferenceable();
77              this.cluSetIds = new ArrayList<String>(cluSet.getCluSetIds());
78              this.cluIds = new ArrayList<String>(cluSet.getCluIds());
79              this.effectiveDate = (null != cluSet.getEffectiveDate()) ? new Date(cluSet.getEffectiveDate().getTime()) : null;
80              this.expirationDate = (null != cluSet.getExpirationDate()) ? new Date(cluSet.getExpirationDate().getTime()) : null;
81          }
82      }
83  
84      @Override
85      public List<String> getCluSetIds() {
86          if (cluSetIds == null) {
87              cluSetIds = new ArrayList<String>();
88          }
89          return cluSetIds;
90      }
91  
92      public void setCluSetIds(List<String> cluSetIds) {
93          this.cluSetIds = cluSetIds;
94      }
95  
96      @Override
97      public List<String> getCluIds() {
98          if (cluIds == null) {
99              cluIds = new ArrayList<String>();
100         }
101         return cluIds;
102     }
103 
104     public void setCluIds(List<String> cluIds) {
105         this.cluIds = cluIds;
106     }
107 
108     @Override
109     public MembershipQueryInfo getMembershipQuery() {
110         return membershipQuery;
111     }
112 
113     public void setMembershipQuery(MembershipQueryInfo membershipQuery) {
114         this.membershipQuery = membershipQuery;
115     }
116 
117     @Override
118     public String getAdminOrg() {
119         return adminOrg;
120     }
121 
122     public void setAdminOrg(String adminOrg) {
123         this.adminOrg = adminOrg;
124     }
125 
126     @Override
127     public Boolean getIsReusable() {
128         return isReusable;
129     }
130 
131     public void setIsReusable(Boolean isReusable) {
132         this.isReusable = isReusable;
133     }
134 
135     @Override
136     public Boolean getIsReferenceable() {
137         return isReferenceable;
138     }
139 
140     public void setIsReferenceable(Boolean isReferenceable) {
141         this.isReferenceable = isReferenceable;
142     }
143 
144     @Override
145     public Date getEffectiveDate() {
146         return effectiveDate;
147     }
148 
149     public void setEffectiveDate(Date effectiveDate) {
150         this.effectiveDate = effectiveDate;
151     }
152 
153     @Override
154     public Date getExpirationDate() {
155         return expirationDate;
156     }
157 
158     public void setExpirationDate(Date expirationDate) {
159         this.expirationDate = expirationDate;
160     }
161 
162 }