View Javadoc

1   /**
2    * Copyright 2011 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  package org.kuali.mobility.events.entity;
16  
17  import java.io.Serializable;
18  import java.util.ArrayList;
19  import java.util.Date;
20  import java.util.List;
21  
22  import javax.xml.bind.annotation.XmlElement;
23  import javax.xml.bind.annotation.XmlRootElement;
24  
25  @XmlRootElement(name = "event")
26  public class EventImpl implements Serializable, Event {
27  
28      private static final long serialVersionUID = -2196031917411001051L;
29      private String eventId;
30      private boolean allDay;
31      private String title;
32      private Date startDate;
33      private Date endDate;
34      private String displayStartDate;
35      private String displayEndDate;
36      private String displayStartTime;
37      private String displayEndTime;
38      private String location;
39      private List<String> description;
40      private String link;
41      private List<EventContactImpl> contact;
42      private String cost;
43      private List<ArrayList<String>> otherInfo;
44      private CategoryImpl category;
45      private String type;
46  
47   
48      /* (non-Javadoc)
49  	 * @see org.kuali.mobility.events.entity.Event#getOtherInfo()
50  	 */
51      @XmlElement(name = "otherInfo")
52      @Override
53  	public List<ArrayList<String>> getOtherInfo() {
54          return otherInfo;
55      }
56  
57      /* (non-Javadoc)
58  	 * @see org.kuali.mobility.events.entity.Event#setOtherInfo(java.util.List)
59  	 */
60      @Override
61  	public void setOtherInfo(List<? extends List<String>> otherInfo) {
62          this.otherInfo = (List<ArrayList<String>>) otherInfo;
63      }
64  
65   
66      /* (non-Javadoc)
67  	 * @see org.kuali.mobility.events.entity.Event#getCost()
68  	 */
69      @Override
70  	public String getCost() { 
71          return cost;
72      }
73  
74      /* (non-Javadoc)
75  	 * @see org.kuali.mobility.events.entity.Event#setCost(java.lang.String)
76  	 */
77      @Override
78  	public void setCost(String cost) {
79          this.cost = cost;
80      }
81  
82      /* (non-Javadoc)
83  	 * @see org.kuali.mobility.events.entity.Event#getEndDate()
84  	 */
85      @Override
86  	public Date getEndDate() {
87          return endDate;
88      }
89  
90      /* (non-Javadoc)
91  	 * @see org.kuali.mobility.events.entity.Event#setEndDate(java.util.Date)
92  	 */
93      @Override
94  	public void setEndDate(Date endDate) {
95          this.endDate = endDate;
96      }
97  
98      /* (non-Javadoc)
99  	 * @see org.kuali.mobility.events.entity.Event#getDisplayStartTime()
100 	 */
101     @Override
102 	public String getDisplayStartTime() {
103         return displayStartTime;
104     }
105 
106     /* (non-Javadoc)
107 	 * @see org.kuali.mobility.events.entity.Event#setDisplayStartTime(java.lang.String)
108 	 */
109     @Override
110 	public void setDisplayStartTime(String displayStartTime) {
111         this.displayStartTime = displayStartTime;
112     }
113 
114     /* (non-Javadoc)
115 	 * @see org.kuali.mobility.events.entity.Event#getDisplayEndTime()
116 	 */
117     @Override
118 	public String getDisplayEndTime() {
119         return displayEndTime;
120     }
121 
122     /* (non-Javadoc)
123 	 * @see org.kuali.mobility.events.entity.Event#setDisplayEndTime(java.lang.String)
124 	 */
125     @Override
126 	public void setDisplayEndTime(String displayEndTime) {
127         this.displayEndTime = displayEndTime;
128     }
129 
130     /* (non-Javadoc)
131 	 * @see org.kuali.mobility.events.entity.Event#getDescription()
132 	 */
133     @XmlElement(name = "description")
134     @Override
135 	public List<String> getDescription() {
136         return description;
137     }
138 
139     /* (non-Javadoc)
140 	 * @see org.kuali.mobility.events.entity.Event#setDescription(java.util.List)
141 	 */
142     @Override
143 	public void setDescription(List<String> description) {
144         this.description = description;
145     }
146 
147     /* (non-Javadoc)
148 	 * @see org.kuali.mobility.events.entity.Event#getDisplayEndDate()
149 	 */
150     @Override
151 	public String getDisplayEndDate() {
152         return displayEndDate;
153     }
154 
155     /* (non-Javadoc)
156 	 * @see org.kuali.mobility.events.entity.Event#setDisplayEndDate(java.lang.String)
157 	 */
158     @Override
159 	public void setDisplayEndDate(String displayEndDate) {
160         this.displayEndDate = displayEndDate;
161     }
162 
163     /* (non-Javadoc)
164 	 * @see org.kuali.mobility.events.entity.Event#getLocation()
165 	 */
166     @Override
167 	public String getLocation() {
168         return location;
169     }
170 
171     /* (non-Javadoc)
172 	 * @see org.kuali.mobility.events.entity.Event#setLocation(java.lang.String)
173 	 */
174     @Override
175 	public void setLocation(String location) {
176         this.location = location;
177     }
178 
179     /* (non-Javadoc)
180 	 * @see org.kuali.mobility.events.entity.Event#getLink()
181 	 */
182     @Override
183 	public String getLink() {
184         return link;
185     }
186 
187     /* (non-Javadoc)
188 	 * @see org.kuali.mobility.events.entity.Event#setLink(java.lang.String)
189 	 */
190     @Override
191 	public void setLink(String link) {
192         this.link = link;
193     }
194 
195     /* (non-Javadoc)
196 	 * @see org.kuali.mobility.events.entity.Event#getDisplayStartDate()
197 	 */
198     @Override
199 	public String getDisplayStartDate() {
200         return displayStartDate;
201     }
202 
203     /* (non-Javadoc)
204 	 * @see org.kuali.mobility.events.entity.Event#setDisplayStartDate(java.lang.String)
205 	 */
206     @Override
207 	public void setDisplayStartDate(String displayStartDate) {
208         this.displayStartDate = displayStartDate;
209     }
210 
211     /* (non-Javadoc)
212 	 * @see org.kuali.mobility.events.entity.Event#isAllDay()
213 	 */
214     @Override
215 	public boolean isAllDay() {
216         return allDay;
217     }
218 
219     /* (non-Javadoc)
220 	 * @see org.kuali.mobility.events.entity.Event#setAllDay(boolean)
221 	 */
222     @Override
223 	public void setAllDay(boolean allDay) {
224         this.allDay = allDay;
225     }
226 
227     /* (non-Javadoc)
228 	 * @see org.kuali.mobility.events.entity.Event#getEventId()
229 	 */
230     @Override
231 	public String getEventId() {
232         return eventId;
233     }
234 
235     /* (non-Javadoc)
236 	 * @see org.kuali.mobility.events.entity.Event#setEventId(java.lang.String)
237 	 */
238     @Override
239 	public void setEventId(String eventId) {
240         this.eventId = eventId;
241     }
242 
243     /* (non-Javadoc)
244 	 * @see org.kuali.mobility.events.entity.Event#getTitle()
245 	 */
246     @Override
247 	public String getTitle() {
248         return title;
249     }
250 
251     /* (non-Javadoc)
252 	 * @see org.kuali.mobility.events.entity.Event#setTitle(java.lang.String)
253 	 */
254     @Override
255 	public void setTitle(String title) {
256         this.title = title;
257     }
258 
259     /* (non-Javadoc)
260 	 * @see org.kuali.mobility.events.entity.Event#getStartDate()
261 	 */
262     @Override
263 	public Date getStartDate() {
264         return startDate;
265     }
266 
267     /* (non-Javadoc)
268 	 * @see org.kuali.mobility.events.entity.Event#setStartDate(java.util.Date)
269 	 */
270     @Override
271 	public void setStartDate(Date startDate) {
272         this.startDate = startDate;
273     }
274 
275     /* (non-Javadoc)
276 	 * @see org.kuali.mobility.events.entity.Event#setCategory(org.kuali.mobility.events.entity.Category)
277 	 */
278     @Override
279 	public void setCategory(Category category) {
280         this.category = (CategoryImpl)category;
281     }
282 
283     /* (non-Javadoc)
284 	 * @see org.kuali.mobility.events.entity.Event#getCategory()
285 	 */
286     @Override
287 	public CategoryImpl getCategory() {
288         return category;
289     }
290     
291     /* (non-Javadoc)
292 	 * @see org.kuali.mobility.events.entity.Event#equals(java.lang.Object)
293 	 */
294     @Override
295 	public boolean equals( Object o )
296     {
297         boolean isEqual = false;
298         
299         if( o != null && o instanceof Event )
300         {
301             if( getEventId() != null && getEventId().equalsIgnoreCase( ((Event)o).getEventId() ) )
302             {
303                 isEqual = true;
304             }
305         }
306         
307         return isEqual;
308     }
309     
310     /* (non-Javadoc)
311 	 * @see org.kuali.mobility.events.entity.Event#hashCode()
312 	 */
313     @Override
314 	public int hashCode()
315         {
316             return (41 + Integer.parseInt( getEventId().substring(5) ) );
317         }
318 
319     @XmlElement(name = "contact")
320 	public List<EventContactImpl> getContact() {
321 		return contact;
322 	}
323 
324 	public void setContact(List<? extends EventContact> contact) {
325 		this.contact = (List<EventContactImpl>)(List<?>) contact;
326 	}
327 
328     @Override
329     public String getType() {
330         return type;
331     }
332 
333     @Override
334     public void setType(String eType) {
335         this.type = eType;
336     }
337 }