1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34 package fr.paris.lutece.plugins.appointment.business.slot;
35
36 import java.io.Serializable;
37 import java.sql.Timestamp;
38 import java.time.LocalDate;
39 import java.time.LocalDateTime;
40 import java.time.LocalTime;
41
42 import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
43
44
45
46
47
48
49
50 @JsonIgnoreProperties( ignoreUnknown = true )
51 public final class Slot implements Serializable, Cloneable
52 {
53
54
55
56
57 private static final long serialVersionUID = 9054234926836931062L;
58
59
60
61
62 private int _nIdSlot;
63
64
65
66
67 private LocalDate _date;
68
69
70
71
72 private LocalTime _startingTime;
73
74
75
76
77 private LocalTime _endingTime;
78
79
80
81
82 private LocalDateTime _startingDateTime;
83
84
85
86
87 private LocalDateTime _endingDateTime;
88
89
90
91
92 private boolean _bIsOpen;
93
94
95
96
97 private boolean _bIsSpecific;
98
99
100
101
102 private boolean _bIsPassed = Boolean.FALSE;
103
104
105
106
107 private int _nMaxCapacity;
108
109
110
111
112 private int _nNbRemainingPlaces;
113
114
115
116
117 private int _nNbPotentialRemainingPlaces;
118
119
120
121
122 private int _nNbPlacesTaken;
123
124
125
126
127 private int _nIdForm;
128
129
130
131 private int _bIsFull;
132
133
134
135
136
137
138 public int getIdSlot( )
139 {
140 return _nIdSlot;
141 }
142
143
144
145
146
147
148 public LocalDate getDate( )
149 {
150 return _date;
151 }
152
153
154
155
156
157
158
159 public void setDate( LocalDate date )
160 {
161 this._date = date;
162 }
163
164
165
166
167
168
169 public LocalTime getStartingTime( )
170 {
171 return _startingTime;
172 }
173
174
175
176
177
178
179
180 public void setStartingTime( LocalTime startingTime )
181 {
182 this._startingTime = startingTime;
183 }
184
185
186
187
188
189
190 public LocalTime getEndingTime( )
191 {
192 return _endingTime;
193 }
194
195
196
197
198
199
200
201 public void setEndingTime( LocalTime endingTime )
202 {
203 this._endingTime = endingTime;
204 }
205
206
207
208
209
210
211
212 public void setIdSlot( int nIdSlot )
213 {
214 this._nIdSlot = nIdSlot;
215 }
216
217
218
219
220
221
222 public LocalDateTime getStartingDateTime( )
223 {
224 return _startingDateTime;
225 }
226
227
228
229
230
231
232 public Timestamp getStartingTimestampDate( )
233 {
234 Timestamp timestamp = null;
235 if ( this._startingDateTime != null )
236 {
237 timestamp = Timestamp.valueOf( this._startingDateTime );
238 }
239 return timestamp;
240 }
241
242
243
244
245
246
247
248 public void setStartingDateTime( LocalDateTime startingDateTime )
249 {
250 this._startingDateTime = startingDateTime;
251 }
252
253
254
255
256
257
258
259 public void setStartingTimeStampDate( Timestamp startingTimeStampDate )
260 {
261 if ( startingTimeStampDate != null )
262 {
263 this._startingDateTime = startingTimeStampDate.toLocalDateTime( );
264 }
265 }
266
267
268
269
270
271
272 public LocalDateTime getEndingDateTime( )
273 {
274 return _endingDateTime;
275 }
276
277
278
279
280
281
282 public Timestamp getEndingTimestampDate( )
283 {
284 Timestamp timestamp = null;
285 if ( this._endingDateTime != null )
286 {
287 timestamp = Timestamp.valueOf( _endingDateTime );
288 }
289 return timestamp;
290 }
291
292
293
294
295
296
297
298 public void setEndingDateTime( LocalDateTime endingDateTime )
299 {
300 this._endingDateTime = endingDateTime;
301 }
302
303
304
305
306
307
308
309 public void setEndingTimeStampDate( Timestamp endingTimeStampDate )
310 {
311 if ( endingTimeStampDate != null )
312 {
313 this._endingDateTime = endingTimeStampDate.toLocalDateTime( );
314 }
315 }
316
317
318
319
320
321
322 public boolean getIsOpen( )
323 {
324 return _bIsOpen;
325 }
326
327
328
329
330
331
332
333 public void setIsOpen( boolean bIsOpen )
334 {
335 this._bIsOpen = bIsOpen;
336 }
337
338
339
340
341
342
343 public boolean getIsSpecific( )
344 {
345 return _bIsSpecific;
346 }
347
348
349
350
351
352
353
354 public void setIsSpecific( boolean bIsSpecific )
355 {
356 this._bIsSpecific = bIsSpecific;
357 }
358
359
360
361
362
363
364 public boolean getIsPassed( )
365 {
366 return _bIsPassed;
367 }
368
369
370
371
372
373
374
375 public void setIsPassed( boolean bIsPassed )
376 {
377 this._bIsPassed = bIsPassed;
378 }
379
380
381
382
383
384
385 public int getNbRemainingPlaces( )
386 {
387 return _nNbRemainingPlaces;
388 }
389
390
391
392
393
394
395
396 public void setNbRemainingPlaces( int nNbRemainingPlaces )
397 {
398 this._nNbRemainingPlaces = nNbRemainingPlaces;
399 }
400
401
402
403
404
405
406 public int getNbPotentialRemainingPlaces( )
407 {
408 return _nNbPotentialRemainingPlaces;
409 }
410
411
412
413
414
415
416
417 public void setNbPotentialRemainingPlaces( int nNbPotentialRemainingPlaces )
418 {
419 this._nNbPotentialRemainingPlaces = nNbPotentialRemainingPlaces;
420 }
421
422
423
424
425
426
427 public int getNbPlacesTaken( )
428 {
429 return _nNbPlacesTaken;
430 }
431
432
433
434
435
436
437
438 public void setNbPlacestaken( int nNbPlacestaken )
439 {
440 this._nNbPlacesTaken = nNbPlacestaken;
441 }
442
443
444
445
446
447
448 public int getMaxCapacity( )
449 {
450 return _nMaxCapacity;
451 }
452
453
454
455
456
457
458
459 public void setMaxCapacity( int nMaxCapacity )
460 {
461 this._nMaxCapacity = nMaxCapacity;
462 }
463
464
465
466
467
468
469 public int getIdForm( )
470 {
471 return _nIdForm;
472 }
473
474
475
476
477
478
479
480 public void setIdForm( int nIdForm )
481 {
482 this._nIdForm = nIdForm;
483 }
484
485
486
487
488
489
490 public boolean getIsFull( )
491 {
492 if ( _bIsFull == 1 )
493 {
494 return true;
495 }
496 return _nNbPotentialRemainingPlaces <= 0;
497
498 }
499
500
501
502
503
504
505
506 public void setIsFull( int bIsFull )
507 {
508 _bIsFull = bIsFull;
509 }
510 @Override
511 public Slot clone() throws CloneNotSupportedException {
512 return (Slot) super.clone();
513 }
514 }