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