View Javadoc
1   /*
2    * Copyright (c) 2002-2017, 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.transparency.business;
35  
36  import javax.validation.constraints.*;
37  import org.hibernate.validator.constraints.*;
38  import java.io.Serializable;
39  import java.sql.Date;
40  import java.util.ArrayList;
41  import java.util.List;
42  
43  /**
44   * This is the business class for the object Appointment
45   */
46  public class Appointment implements Serializable
47  {
48      private static final long serialVersionUID = 1L;
49  
50      // Variables declarations
51      private int _nId;
52  
53      @NotEmpty( message = "#i18n{transparency.validation.appointment.Title.notEmpty}" )
54      @Size( max = 255, message = "#i18n{transparency.validation.appointment.Title.size}" )
55      private String _strTitle;
56  
57      private String _strDescription;
58  
59      @Past( message = "#i18n{transparency.validation.appointment.StartDate.past}" )
60      private Date _dateStartDate;
61  
62      private Date _dateEndDate;
63  
64      private int _nTypeId;
65  
66      @Size( max = 255, message = "#i18n{transparency.validation.appointment.TypeLabel.size}" )
67      private String _strTypeLabel;
68      @URL( message = "#i18n{portal.validation.message.url}" )
69      @Size( max = 255, message = "#i18n{transparency.validation.appointment.Url.size}" )
70      private String _strUrl;
71  
72      private List<ElectedOfficial> electedOfficialList = new ArrayList<>( );
73      private List<Lobby> lobbyList = new ArrayList<>( );
74  
75      @NotEmpty( message = "#i18n{transparency.validation.appointment.Contacts.notEmpty}" )
76      @Size( max = 255, message = "#i18n{transparency.validation.appointment.Contacts.size}" )
77      private String _strContacts;
78  
79      public static String RESOURCE_TYPE = "transparency_appointment_type";
80      
81      /**
82       * Returns the Id
83       * 
84       * @return The Id
85       */
86      public int getId( )
87      {
88          return _nId;
89      }
90  
91      /**
92       * Sets the Id
93       * 
94       * @param nId
95       *            The Id
96       */
97      public void setId( int nId )
98      {
99          _nId = nId;
100     }
101 
102     /**
103      * Returns the Title
104      * 
105      * @return The Title
106      */
107     public String getTitle( )
108     {
109         return _strTitle;
110     }
111 
112     /**
113      * Sets the Title
114      * 
115      * @param strTitle
116      *            The Title
117      */
118     public void setTitle( String strTitle )
119     {
120         _strTitle = strTitle;
121     }
122 
123     /**
124      * Returns the Description
125      * 
126      * @return The Description
127      */
128     public String getDescription( )
129     {
130         return _strDescription;
131     }
132 
133     /**
134      * Sets the Description
135      * 
136      * @param strDescription
137      *            The Description
138      */
139     public void setDescription( String strDescription )
140     {
141         _strDescription = strDescription;
142     }
143 
144     /**
145      * Returns the StartDate
146      * 
147      * @return The StartDate
148      */
149     public Date getStartDate( )
150     {
151         return _dateStartDate;
152     }
153 
154     /**
155      * Sets the StartDate
156      * 
157      * @param dateStartDate
158      *            The StartDate
159      */
160     public void setStartDate( Date dateStartDate )
161     {
162         _dateStartDate = dateStartDate;
163     }
164 
165     /**
166      * Returns the EndDate
167      * 
168      * @return The EndDate
169      */
170     public Date getEndDate( )
171     {
172         return _dateEndDate;
173     }
174 
175     /**
176      * Sets the EndDate
177      * 
178      * @param dateEndDate
179      *            The EndDate
180      */
181     public void setEndDate( Date dateEndDate )
182     {
183         _dateEndDate = dateEndDate;
184     }
185 
186     /**
187      * Returns the TypeId
188      * 
189      * @return The TypeId
190      */
191     public int getTypeId( )
192     {
193         return _nTypeId;
194     }
195 
196     /**
197      * Sets the TypeId
198      * 
199      * @param nTypeId
200      *            The TypeId
201      */
202     public void setTypeId( int nTypeId )
203     {
204         _nTypeId = nTypeId;
205     }
206 
207     /**
208      * Returns the TypeLabel
209      * 
210      * @return The TypeLabel
211      */
212     public String getTypeLabel( )
213     {
214         return _strTypeLabel;
215     }
216 
217     /**
218      * Sets the TypeLabel
219      * 
220      * @param strTypeLabel
221      *            The TypeLabel
222      */
223     public void setTypeLabel( String strTypeLabel )
224     {
225         _strTypeLabel = strTypeLabel;
226     }
227 
228     /**
229      * Returns the Url
230      * 
231      * @return The Url
232      */
233     public String getUrl( )
234     {
235         return _strUrl;
236     }
237 
238     /**
239      * Sets the Url
240      * 
241      * @param strUrl
242      *            The Url
243      */
244     public void setUrl( String strUrl )
245     {
246         _strUrl = strUrl;
247     }
248 
249     /**
250      * get Elected Official List
251      * 
252      * @return Elected Official List
253      */
254     public List<ElectedOfficial> getElectedOfficialList( )
255     {
256         return electedOfficialList;
257     }
258 
259     /**
260      * set Elected Official List
261      * 
262      * @param electedOfficialList
263      */
264     public void setElectedOfficialList( List<ElectedOfficial> electedOfficialList )
265     {
266         this.electedOfficialList = electedOfficialList;
267     }
268 
269     /**
270      * get Lobby List
271      * 
272      * @return lobby List
273      */
274     public List<Lobby> getLobbyList( )
275     {
276         return lobbyList;
277     }
278 
279     /**
280      * set Lobby List
281      * 
282      * @param lobbyList
283      */
284     public void setLobbyList( List<Lobby> lobbyList )
285     {
286         this.lobbyList = lobbyList;
287     }
288 
289     /**
290      * get Contacts
291      * 
292      * @return the contacts
293      */
294     public String getContacts( )
295     {
296         return _strContacts;
297     }
298 
299     /**
300      * set Contacts
301      * 
302      * @param _strContacts
303      */
304     public void setContacts( String _strContacts )
305     {
306         this._strContacts = _strContacts;
307     }
308 
309 }