View Javadoc

1   /**
2    * Copyright 2012 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   * Created by mahtabme on 10/4/12
16   */
17  package org.kuali.student.enrollment.lui.dto;
18  
19  import org.kuali.student.enrollment.lui.infc.LuiSet;
20  import org.kuali.student.r2.common.dto.IdEntityInfo;
21  
22  import javax.xml.bind.annotation.XmlAccessType;
23  import javax.xml.bind.annotation.XmlAccessorType;
24  import javax.xml.bind.annotation.XmlElement;
25  import javax.xml.bind.annotation.XmlType;
26  import java.io.Serializable;
27  import java.util.ArrayList;
28  import java.util.Date;
29  import java.util.List;
30  
31  /**
32   * This class represents a set of Luis "connected" in some manner.
33   *
34   * @author Kuali Student Team (ks.collab@kuali.org)
35   */
36  @XmlAccessorType(XmlAccessType.FIELD)
37  @XmlType(name = "LuiSetInfo", propOrder = {"id", "descr", "stateKey", "typeKey", "name", "luiIds",
38          "effectiveDate", "expirationDate", "meta", "attributes" })
39  public class LuiSetInfo extends IdEntityInfo implements Serializable, LuiSet {
40  
41      ///////////////////////////////
42      // Constants
43      ///////////////////////////////
44  
45      private static final long serialVersionUID = 1L;
46  
47      ///////////////////////////////
48      // Data Variables
49      ///////////////////////////////
50  
51      @XmlElement
52      private List<String> luiIds;
53  
54      @XmlElement
55      private Date effectiveDate;
56  
57      @XmlElement
58      private Date expirationDate;
59  
60      ///////////////////////////////
61      // Constructors
62      ///////////////////////////////
63  
64      public LuiSetInfo() {
65  
66      }
67  
68      public LuiSetInfo(LuiSet luiSet) {
69          super(luiSet);
70          if (null != luiSet) {
71              this.luiIds = new ArrayList<String>(luiSet.getLuiIds());
72              this.effectiveDate = (null != luiSet.getEffectiveDate()) ? new Date(luiSet.getEffectiveDate().getTime()) : null;
73              this.expirationDate = (null != luiSet.getExpirationDate()) ? new Date(luiSet.getExpirationDate().getTime()) : null;
74          }
75      }
76  
77      ///////////////////////////////
78      // Getters and Setters
79      ///////////////////////////////
80  
81      public List<String> getLuiIds() {
82          if (luiIds== null) {
83              luiIds= new ArrayList<String>();
84          }
85          return luiIds;
86      }
87  
88      public void setLuiIds(List<String> luiIds) {
89          this.luiIds = luiIds;
90      }
91  
92      @Override
93      public Date getEffectiveDate() {
94          return effectiveDate;
95      }
96  
97      public void setEffectiveDate(Date effectiveDate) {
98          this.effectiveDate = effectiveDate;
99      }
100 
101     @Override
102     public Date getExpirationDate() {
103         return expirationDate;
104     }
105 
106     public void setExpirationDate(Date expirationDate) {
107         this.expirationDate = expirationDate;
108     }
109 
110 }