View Javadoc
1   /*
2    * Copyright (c) 2002-2022, City of 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.comment;
35  
36  import java.io.Serializable;
37  import java.time.LocalDate;
38  import java.time.LocalTime;
39  
40  import javax.validation.constraints.NotEmpty;
41  import javax.validation.constraints.NotNull;
42  
43  /**
44   * This is the business class for the object Comment
45   */
46  public class Comment implements Serializable
47  {
48      private static final long serialVersionUID = 1L;
49  
50      // Variables declarations
51      private int _nId;
52  
53      private int _nIdForm;
54      @NotNull( message = "#i18n{portal.validation.message.notEmpty}" )
55      private LocalDate _dateStartingValidityDate;
56      @NotNull( message = "#i18n{portal.validation.message.notEmpty}" )
57      private LocalDate _dateEndingValidityDate;
58      private LocalTime _timeStartingValidityTime;
59      private LocalTime _timeEndingValidityTime;
60      @NotEmpty( message = "#i18n{appointment.validation.comment.Comment.notEmpty}" )
61      private String _strComment;
62  
63      private LocalDate _dateCreationDate;
64  
65      /**
66       * The User who created the comment (if not created by the user himself)
67       */
68      private String _strCreatorUserConnectId;
69  
70      /**
71       * Returns the Id
72       * 
73       * @return The Id
74       */
75      public int getId( )
76      {
77          return _nId;
78      }
79  
80      /**
81       * Sets the Id
82       * 
83       * @param nId
84       *            The Id
85       */
86      public void setId( int nId )
87      {
88          _nId = nId;
89      }
90  
91      /**
92       * Returns the IdForm
93       * 
94       * @return The IdForm
95       */
96      public int getIdForm( )
97      {
98          return _nIdForm;
99      }
100 
101     /**
102      * Sets the IdForm
103      * 
104      * @param nIdForm
105      *            The IdForm
106      */
107     public void setIdForm( int nIdForm )
108     {
109         _nIdForm = nIdForm;
110     }
111 
112     /**
113      * Returns the StartingValidityDate
114      * 
115      * @return The StartingValidityDate
116      */
117     public LocalDate getStartingValidityDate( )
118     {
119         return _dateStartingValidityDate;
120     }
121 
122     /**
123      * Sets the StartingValidityDate
124      * 
125      * @param dateStartingValidityDate
126      *            The StartingValidityDate
127      */
128     public void setStartingValidityDate( LocalDate dateStartingValidityDate )
129     {
130         _dateStartingValidityDate = dateStartingValidityDate;
131     }
132 
133     /**
134      * Returns the EndingValidityDate
135      * 
136      * @return The EndingValidityDate
137      */
138     public LocalDate getEndingValidityDate( )
139     {
140         return _dateEndingValidityDate;
141     }
142 
143     /**
144      * Sets the EndingValidityDate
145      * 
146      * @param dateEndingValidityDate
147      *            The EndingValidityDate
148      */
149     public void setEndingValidityDate( LocalDate dateEndingValidityDate )
150     {
151         _dateEndingValidityDate = dateEndingValidityDate;
152     }
153 
154     /**
155      * Returns the Comment
156      * 
157      * @return The Comment
158      */
159     public String getComment( )
160     {
161         return _strComment;
162     }
163 
164     /**
165      * Sets the Comment
166      * 
167      * @param strComment
168      *            The Comment
169      */
170     public void setComment( String strComment )
171     {
172         _strComment = strComment;
173     }
174 
175     /**
176      * Returns the CreationDate
177      * 
178      * @return The CreationDate
179      */
180     public LocalDate getCreationDate( )
181     {
182         return _dateCreationDate;
183     }
184 
185     /**
186      * Sets the CreationDate
187      * 
188      * @param dateCreationDate
189      *            The CreationDate
190      */
191     public void setCreationDate( LocalDate dateCreationDate )
192     {
193         _dateCreationDate = dateCreationDate;
194     }
195 
196     /**
197      * UserConnectId
198      * 
199      * @return The _strCreatorUserConnectId
200      */
201     public String getCreatorUserName( )
202     {
203         return _strCreatorUserConnectId;
204     }
205 
206     /**
207      * Sets the strCreatorUserConnectId
208      * 
209      * @param creatorUserConnectId
210      *            The creatorUserConnectId
211      */
212     public void setCreatorUserName( String creatorUserConnectId )
213     {
214         _strCreatorUserConnectId = creatorUserConnectId;
215     }
216 
217     /**
218      * Returns the StartingValidityTime
219      * 
220      * @return The StartingValidityTime
221      */
222     public LocalTime getStartingValidityTime( )
223     {
224         return _timeStartingValidityTime;
225     }
226 
227     /**
228      * Sets the StartingValidityTime
229      * 
230      * @param timeStartingValidityTime
231      *            The StartingValidityTime
232      */
233     public void setStartingValidityTime( LocalTime timeStartingValidityTime )
234     {
235         _timeStartingValidityTime = timeStartingValidityTime;
236     }
237 
238     /**
239      * Returns the EndingValidityTime
240      * 
241      * @return The EndingValidityTime
242      */
243     public LocalTime getEndingValidityTime( )
244     {
245         return _timeEndingValidityTime;
246     }
247 
248     /**
249      * Sets the EndingValidityTime
250      * 
251      * @param timeEndingValidityTime
252      *            The EndingValidityTime
253      */
254     public void setEndingValidityTime( LocalTime timeEndingValidityTime )
255     {
256         _timeEndingValidityTime = timeEndingValidityTime;
257     }
258 
259     /**
260      * Gets the DateCalendarAllDaySlotEnd
261      * 
262      * @return The DateCalendarAllDaySlotEnd
263      */
264     public LocalDate getCalendarAllDaySlotEnd( )
265     {
266         return _dateEndingValidityDate.plusDays( 1 );
267     }
268 }