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.user;
35  
36  import java.io.Serializable;
37  import java.util.List;
38  
39  import javax.validation.constraints.Size;
40  
41  import org.hibernate.validator.constraints.Email;
42  import org.hibernate.validator.constraints.NotBlank;
43  
44  import fr.paris.lutece.plugins.appointment.business.appointment.Appointment;
45  
46  /**
47   * Business class of the User
48   * 
49   * @author Laurent Payen
50   *
51   */
52  public class User implements Serializable
53  {
54  
55      /**
56       * Serial version UID
57       */
58      private static final long serialVersionUID = -5088753000751258184L;
59  
60      /**
61       * User Id
62       */
63      private int _nIdUser;
64  
65      /**
66       * GUID
67       */
68      private String _strGuid;
69  
70      /**
71       * First name of the User
72       */
73      @NotBlank( message = "appointment.validation.appointment.FirstName.notEmpty" )
74      @Size( max = 255, message = "appointment.validation.appointment.FirstName.size" )
75      private String _strFirstName;
76  
77      /**
78       * Last name of the User
79       */
80      @NotBlank( message = "appointment.validation.appointment.LastName.notEmpty" )
81      @Size( max = 255, message = "appointment.validation.appointment.LastName.size" )
82      private String _strLastName;
83  
84      /**
85       * Email of the User (RFC 2822)
86       */
87      @Size( max = 255, message = "appointment.validation.appointment.Email.size" )
88      @Email( regexp = "^$|(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])", message = "appointment.validation.appointment.Email.email" )
89      private String _strEmail;
90  
91      /**
92       * Phone number of the User
93       */
94      private String _strPhoneNumber;
95  
96      /**
97       * Appointments of the User
98       */
99      private List<Appointment> _listAppointments;
100 
101     /**
102      * Get the Id of the User
103      * 
104      * @return the Id of the User
105      */
106     public int getIdUser( )
107     {
108         return _nIdUser;
109     }
110 
111     /**
112      * Set the Id of the User
113      * 
114      * @param nIdUser
115      *            the Id to set
116      */
117     public void setIdUser( int nIdUser )
118     {
119         this._nIdUser = nIdUser;
120     }
121 
122     /**
123      * Get the Guid of the User
124      * 
125      * @return the Guid
126      */
127     public String getGuid( )
128     {
129         return _strGuid;
130     }
131 
132     /**
133      * Set the Guid
134      * 
135      * @param strGuid
136      *            the Guid
137      */
138     public void setGuid( String strGuid )
139     {
140         this._strGuid = strGuid;
141     }
142 
143     /**
144      * Get the first name of the User
145      * 
146      * @return the first name of the User
147      */
148     public String getFirstName( )
149     {
150         return _strFirstName;
151     }
152 
153     /**
154      * Set the User first name
155      * 
156      * @param strFirstName
157      *            the first name to set
158      */
159     public void setFirstName( String strFirstName )
160     {
161         this._strFirstName = strFirstName;
162     }
163 
164     /**
165      * Get the last name of the User
166      * 
167      * @return the last name of the USer
168      */
169     public String getLastName( )
170     {
171         return _strLastName;
172     }
173 
174     /**
175      * Set the last name of the User
176      * 
177      * @param strLastName
178      *            the last name to set
179      */
180     public void setLastName( String strLastName )
181     {
182         this._strLastName = strLastName;
183     }
184 
185     /**
186      * Get the email of the User
187      * 
188      * @return the email of the User
189      */
190     public String getEmail( )
191     {
192         return _strEmail;
193     }
194 
195     /**
196      * Set the email of the User
197      * 
198      * @param strEmail
199      *            the email to set
200      */
201     public void setEmail( String strEmail )
202     {
203         this._strEmail = strEmail;
204     }
205 
206     /**
207      * Get the phone number of the USer
208      * 
209      * @return the phone number of the User
210      */
211     public String getPhoneNumber( )
212     {
213         return _strPhoneNumber;
214     }
215 
216     /**
217      * Set the phone number of the User
218      * 
219      * @param strPhoneNumber
220      *            the phone number to set
221      */
222     public void setPhoneNumber( String strPhoneNumber )
223     {
224         this._strPhoneNumber = strPhoneNumber;
225     }
226 
227     /**
228      * Get the appointments of the User
229      * 
230      * @return the list of the User appointments
231      */
232     public List<Appointment> getAppointments( )
233     {
234         return _listAppointments;
235     }
236 
237     /**
238      * Set the appointments of the User
239      * 
240      * @param listAppointments
241      *            the appointments to set
242      */
243     public void setAppointments( List<Appointment> listAppointments )
244     {
245         this._listAppointments = listAppointments;
246     }
247 
248 }