View Javadoc
1   /*
2    * Copyright (c) 2002-2018, Mairie de Paris
3    * All rights reserved.
4    *
5    * Redistribution and use in source and binary forms, with or without
6    * modification, are permitted provided that the following conditions
7    * are met:
8    *
9    *  1. Redistributions of source code must retain the above copyright notice
10   *     and the following disclaimer.
11   *
12   *  2. Redistributions in binary form must reproduce the above copyright notice
13   *     and the following disclaimer in the documentation and/or other materials
14   *     provided with the distribution.
15   *
16   *  3. Neither the name of 'Mairie de Paris' nor 'Lutece' nor the names of its
17   *     contributors may be used to endorse or promote products derived from
18   *     this software without specific prior written permission.
19   *
20   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23   * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS OR CONTRIBUTORS BE
24   * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
25   * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
26   * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
27   * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
28   * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
29   * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
30   * POSSIBILITY OF SUCH DAMAGE.
31   *
32   * License 1.0
33   */
34  package fr.paris.lutece.plugins.appointment.business.appointment;
35  
36  import java.io.Serializable;
37  
38  import fr.paris.lutece.plugins.appointment.business.slot.Slot;
39  import fr.paris.lutece.plugins.appointment.business.user.User;
40  
41  /**
42   * Business class of the Appointment
43   * 
44   * @author Laurent Payen
45   *
46   */
47  public class Appointment extends User implements Serializable
48  {
49  
50      /**
51       * Appointment resource type
52       */
53      public static final String APPOINTMENT_RESOURCE_TYPE = "appointment";
54  
55      /**
56       * Serial version UID
57       */
58      private static final long serialVersionUID = -132212832777629802L;
59  
60      /**
61       * Appointment Id
62       */
63      private int _nIdAppointment;
64  
65      /**
66       * Reference of the Appointment
67       */
68      private String _strReference;
69  
70      /**
71       * Number of places for the appointment
72       */
73      private int _nNbPlaces;
74      /**
75       * Tell if the appointment is cancelled or not
76       */
77      private boolean _bIsCancelled;
78  
79      /**
80       * Id for a cancelled appointment
81       */
82      private int _nIdActionCancelled;
83  
84      /**
85       * The rank for the notification (0 : no notification)
86       */
87      private int _notification;
88  
89      /**
90       * The Admin User Id
91       */
92      private int _nIdAdminUser;
93  
94      /**
95       * User id
96       */
97      private int _nIdUser;
98  
99      /**
100      * Slot id
101      */
102     private int _nIdSlot;
103 
104     /**
105      * The slot on which the appointment is
106      */
107     private Slot _slot;
108 
109     /**
110      * The user of the appointment
111      */
112     private User _user;
113 
114     /**
115      * Get the reference of the appointment
116      * 
117      * @return the reference
118      */
119     public String getReference( )
120     {
121         return _strReference;
122     }
123 
124     /**
125      * Set the reference of the appointment
126      * 
127      * @param strReference
128      *            the reference to set
129      */
130     public void setReference( String strReference )
131     {
132         this._strReference = strReference;
133     }
134 
135     /**
136      * Get the number of places of the appointment
137      * 
138      * @return the number of places
139      */
140     public int getNbPlaces( )
141     {
142         return _nNbPlaces;
143     }
144 
145     /**
146      * Set the number of places for the appointment
147      * 
148      * @param nNbPlaces
149      *            the number of places to set
150      */
151     public void setNbPlaces( int nNbPlaces )
152     {
153         this._nNbPlaces = nNbPlaces;
154     }
155 
156     /**
157      * Get if the appointment is cancelled
158      * 
159      * @return true if the appointment is cancelled
160      */
161     public boolean getIsCancelled( )
162     {
163         return _bIsCancelled;
164     }
165 
166     /**
167      * Set if the appointment is cancelled
168      * 
169      * @param bIsCancelled
170      *            the boolean value to set
171      */
172     public void setIsCancelled( boolean bIsCancelled )
173     {
174         this._bIsCancelled = bIsCancelled;
175     }
176 
177     /**
178      * Get the id for the cancelled appointment
179      * 
180      * @return the id
181      */
182     public int getIdActionCancelled( )
183     {
184         return _nIdActionCancelled;
185     }
186 
187     /**
188      * Set the id for the cancelled action
189      * 
190      * @param nIdActionCancelled
191      *            the id to set
192      */
193     public void setIdActionCancelled( int nIdActionCancelled )
194     {
195         this._nIdActionCancelled = nIdActionCancelled;
196     }
197 
198     /**
199      * Get the rank for the notification (0 = no notification)
200      * 
201      * @return the rank
202      */
203     public int getNotification( )
204     {
205         return _notification;
206     }
207 
208     /**
209      * Set the rank for the notification
210      * 
211      * @param notification
212      *            the rank (default : 0, no notification)
213      */
214     public void setNotification( int notification )
215     {
216         this._notification = notification;
217     }
218 
219     /**
220      * Get the Appointment Id
221      * 
222      * @return the Appointment Id
223      */
224     public int getIdAppointment( )
225     {
226         return _nIdAppointment;
227     }
228 
229     /**
230      * Set the Appointment Id
231      * 
232      * @param nIdAppointment
233      *            the Appointment Id to set
234      */
235     public void setIdAppointment( int nIdAppointment )
236     {
237         this._nIdAppointment = nIdAppointment;
238     }
239 
240     /**
241      * Get the User Id of the Appointment
242      * 
243      * @return the User Id of the Appointment
244      */
245     public int getIdUser( )
246     {
247         return _nIdUser;
248     }
249 
250     /**
251      * Set the User Id of the Appointment
252      * 
253      * @param nIdUser
254      *            the User Id of the Appointment
255      */
256     public void setIdUser( int nIdUser )
257     {
258         this._nIdUser = nIdUser;
259     }
260 
261     public int getIdAdminUser( )
262     {
263         return _nIdAdminUser;
264     }
265 
266     public void setIdAdminUser( int nIdAdminUser )
267     {
268         this._nIdAdminUser = nIdAdminUser;
269     }
270 
271     /**
272      * Get the Slot Id of the Appointment
273      * 
274      * @return the Slot Id of the Appointment
275      */
276     public int getIdSlot( )
277     {
278         return _nIdSlot;
279     }
280 
281     /**
282      * Set the Slot Id of the Appointment
283      * 
284      * @param nIdSlot
285      *            the Slot Id of the Appointment
286      */
287     public void setIdSlot( int nIdSlot )
288     {
289         this._nIdSlot = nIdSlot;
290     }
291 
292     /**
293      * Get the slot of the appointment
294      * 
295      * @return the slot
296      */
297     public Slot getSlot( )
298     {
299         return _slot;
300     }
301 
302     /**
303      * Set the slot of the appointment
304      * 
305      * @param slot
306      *            the slot to set
307      */
308     public void setSlot( Slot slot )
309     {
310         this._slot = slot;
311     }
312 
313     /**
314      * Get the user of the appointment
315      * 
316      * @return the user
317      */
318     public User getUser( )
319     {
320         return _user;
321     }
322 
323     /**
324      * Set the user of the appointment
325      * 
326      * @param user
327      *            the user
328      */
329     public void setUser( User user )
330     {
331         this._user = user;
332     }
333 
334 }