View Javadoc
1   /**
2    * Copyright 2014 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 Charles on 2/11/14
16   */
17  package org.kuali.student.enrollment.courseseatcount.dto;
18  
19  import org.kuali.student.enrollment.courseseatcount.infc.SeatCount;
20  
21  import java.util.Date;
22  
23  /**
24   * This is the structure that represents the seat counts.  Should some be unavailable, then
25   * value can be set to null.  This also includes information related to waitlists.
26   *
27   * @author Kuali Student Team
28   */
29  public class SeatCountInfo implements SeatCount {
30      private Date timestamp;
31      private String luiId;
32      private String luiTypeKey;
33  
34      private Integer totalSeats;
35  
36      private Integer usedSeats;
37      private Integer availableSeats;
38  
39      private boolean hasWaitList; // true, if it has an active waitlist.  If false, other fields
40                                   // below are ignored
41  
42      private Integer maxWaitListSize; // null implies unbounded waitlist size (defined in CourseWaitListInfo)
43      private Integer waitListSize; // Number of students on waitlist
44      // Note: the number of remaining wait list spots can be derived from maxWaitListSize - waitListSize
45  
46      public Integer getMaxWaitListSize() {
47          return maxWaitListSize;
48      }
49  
50      public void setMaxWaitListSize(Integer maxWaitListSize) {
51          this.maxWaitListSize = maxWaitListSize;
52      }
53  
54      public Integer getWaitListSize() {
55          return waitListSize;
56      }
57  
58      public void setWaitListSize(Integer waitListSize) {
59          this.waitListSize = waitListSize;
60      }
61  
62      public boolean hasWaitList() {
63  
64          return hasWaitList;
65      }
66  
67      public void setHasWaitList(boolean hasWaitList) {
68          this.hasWaitList = hasWaitList;
69      }
70  
71  
72      @Override
73      public Integer getTotalSeats() {
74          return totalSeats;
75      }
76  
77      @Override
78      public Integer getUsedSeats() {
79          return usedSeats;
80      }
81  
82      @Override
83      public Integer getAvailableSeats() {
84          return availableSeats;
85      }
86  
87      @Override
88      public Date getTimestamp() {
89          return timestamp;
90      }
91  
92      @Override
93      public String getLuiId() {
94          return luiId;
95      }
96  
97      @Override
98      public String getLuiTypeKey() {
99          return luiTypeKey;
100     }
101 
102     public void setTotalSeats(Integer total) {
103         totalSeats = total;
104     }
105 
106     public void setUsedSeats(Integer used) {
107         usedSeats = used;
108     }
109 
110     public void setAvailableSeats(Integer available) {
111         availableSeats = available;
112     }
113 
114     public void setLuiId(String luiId) {
115         this.luiId = luiId;
116     }
117 
118     public void setLuiTypeKey(String luiTypeKey) {
119         this.luiTypeKey = luiTypeKey;
120     }
121 
122     public void setTimestamp(Date timestamp) {
123         this.timestamp = timestamp;
124     }
125 }