View Javadoc
1   /*
2    * Copyright (c) 2002-2024, 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.grubusiness.business.demand;
35  
36  import com.fasterxml.jackson.annotation.JsonIgnore;
37  import com.fasterxml.jackson.annotation.JsonProperty;
38  import com.fasterxml.jackson.annotation.JsonPropertyOrder;
39  import com.fasterxml.jackson.annotation.JsonRootName;
40  
41  import fr.paris.lutece.plugins.grubusiness.business.customer.Customer;
42  import fr.paris.lutece.plugins.grubusiness.business.notification.Notification;
43  
44  import java.util.ArrayList;
45  import java.util.List;
46  
47  /**
48   * Demand Class
49   */
50  @JsonRootName( value = "demand" )
51  @JsonPropertyOrder( {
52          "id", "type_id", "subtype_id", "reference", "status_id", "max_step", "current_step", "customer"
53  } )
54  public class Demand
55  {
56      // Variables declarations
57      private int _nUId;
58      private String _strId;
59      private String _strReference;
60      private String _strTypeId;
61      private String _strSubtypeId;
62      private int _nStatusId;
63      private String _strTitle;
64      private List<Notification> _listNotifications;
65      private List<Action> _listActions = new ArrayList<Action>( );
66      private long _lCreationDate;
67      private long _lClosureDate;
68      private int _nMaxSteps;
69      private int _nCurrentStep;
70      private boolean _bShowDetails;
71      private Customer _customer;
72      private long _lModifyDate;
73  
74      /**
75       * Get the primary key id
76       * 
77       * @return the technical id
78       */
79      @JsonProperty
80      public int getUID( )
81      {
82          return _nUId;
83      }
84  
85      /**
86       * Set the primary key id
87       * 
88       * @param nUId
89       *            The technical id
90       */
91      @JsonProperty
92      public void setUID( int nUId )
93      {
94          _nUId = nUId;
95      }
96      
97      /**
98       * Get the demand id
99       * 
100      * @return the demand id
101      */
102     @JsonProperty( "id" )
103     public String getId( )
104     {
105         return _strId;
106     }
107 
108     /**
109      * Set the demand id
110      * 
111      * @param strId
112      *            The demand id
113      */
114     @JsonProperty( "id" )
115     public void setId( String strId )
116     {
117         _strId = strId;
118     }
119 
120     /**
121      * Gives the reference
122      *
123      * @return The reference
124      */
125     @JsonProperty( "reference" )
126     public String getReference( )
127     {
128         return _strReference;
129     }
130 
131     /**
132      * Sets the reference
133      *
134      * @param strReference
135      *            The reference
136      */
137     @JsonProperty( "reference" )
138     public void setReference( String strReference )
139     {
140         _strReference = strReference;
141     }
142 
143     /**
144      * Gives the status id
145      *
146      * @return The status id
147      */
148     @JsonProperty( "status_id" )
149     public int getStatusId( )
150     {
151         return _nStatusId;
152     }
153 
154     /**
155      * Sets the status id
156      *
157      * @param nStatusId
158      *            The status id
159      */
160     @JsonProperty( "status_id" )
161     public void setStatusId( int nStatusId )
162     {
163         _nStatusId = nStatusId;
164     }
165 
166     /**
167      * Sets the type id
168      *
169      * @param strTypeId
170      *            The type id
171      */
172     @JsonProperty( "type_id" )
173     public void setTypeId( String strTypeId )
174     {
175         _strTypeId = strTypeId;
176     }
177 
178     /**
179      * Gves the type id
180      *
181      * @return The type id
182      */
183     @JsonProperty( "type_id" )
184     public String getTypeId( )
185     {
186         return _strTypeId;
187     }
188 
189     /**
190      * Sets the subtype id
191      *
192      * @param strSubtypeId
193      *            The subtype id
194      */
195     @JsonProperty( "subtype_id" )
196     public void setSubtypeId( String strSubtypeId )
197     {
198         _strSubtypeId = strSubtypeId;
199     }
200 
201     /**
202      * Gves the subtype id
203      *
204      * @return The subtype id
205      */
206     @JsonProperty( "subtype_id" )
207     public String getSubtypeId( )
208     {
209         return _strSubtypeId;
210     }
211 
212     /**
213      * Returns the Title
214      * 
215      * @return The Title
216      */
217     @JsonIgnore
218     public String getTitle( )
219     {
220         return _strTitle;
221     }
222 
223     /**
224      * Sets the Title
225      * 
226      * @param strTitle
227      *            The Title
228      */
229     public void setTitle( String strTitle )
230     {
231         _strTitle = strTitle;
232     }
233 
234     /**
235      * Returns the Notifications
236      *
237      * @return The Notifications
238      */
239     @JsonIgnore
240     public List<Notification> getNotifications( )
241     {
242         return _listNotifications;
243     }
244 
245     /**
246      * Sets the Notifications
247      *
248      * @param listNotifications
249      *            The Notifications
250      */
251     public void setNotifications( List<Notification> listNotifications )
252     {
253         _listNotifications = listNotifications;
254     }
255 
256     /**
257      * Returns the Actions
258      *
259      * @return The Actions
260      */
261     @JsonIgnore
262     public List<Action> getActions( )
263     {
264         return _listActions;
265     }
266 
267     /**
268      * Sets the Actions
269      *
270      * @param listActions
271      *            The Actions
272      */
273     public void setActions( List<Action> listActions )
274     {
275         _listActions = listActions;
276     }
277 
278     /**
279      * Add an action
280      * 
281      * @param action
282      *            the action to add
283      */
284     public void addAction( Action action )
285     {
286         _listActions.add( action );
287     }
288 
289     /**
290      * Gives the customer
291      * 
292      * @return the customer
293      */
294     @JsonProperty( "customer" )
295     public Customer getCustomer( )
296     {
297         return _customer;
298     }
299 
300     /**
301      * Sets the customer
302      * 
303      * @param customer
304      *            the customer to set
305      */
306     @JsonProperty( "customer" )
307     public void setCustomer( Customer customer )
308     {
309         _customer = customer;
310     }
311 
312     /**
313      * Gives the creation date
314      * 
315      * @return the creation date
316      */
317     @JsonIgnore
318     public long getCreationDate( )
319     {
320         return _lCreationDate;
321     }
322 
323     /**
324      * Sets the creation date
325      * 
326      * @param lCreationDate
327      *            the creation date to set
328      */
329     public void setCreationDate( long lCreationDate )
330     {
331         this._lCreationDate = lCreationDate;
332     }
333 
334     /**
335      * Gives the closure date
336      * 
337      * @return the closure date
338      */
339     @JsonIgnore
340     public long getClosureDate( )
341     {
342         return _lClosureDate;
343     }
344 
345     /**
346      * Sets the closure date
347      * 
348      * @param lClosureDate
349      *            the closure date to set
350      */
351     public void setClosureDate( long lClosureDate )
352     {
353         this._lClosureDate = lClosureDate;
354     }
355 
356     /**
357      * Gives the number of steps
358      * 
359      * @return the number of steps
360      */
361     @JsonProperty( "max_step" )
362     public int getMaxSteps( )
363     {
364         return _nMaxSteps;
365     }
366 
367     /**
368      * Sets the number of steps
369      * 
370      * @param nMaxSteps
371      *            the number of steps to set
372      */
373     @JsonProperty( "max_step" )
374     public void setMaxSteps( int nMaxSteps )
375     {
376         _nMaxSteps = nMaxSteps;
377     }
378 
379     /**
380      * Gives the current step
381      * 
382      * @return the current step
383      */
384     @JsonProperty( "current_step" )
385     public int getCurrentStep( )
386     {
387         return _nCurrentStep;
388     }
389 
390     /**
391      * Sets the current step
392      * 
393      * @param nCurrentStep
394      *            the current step to set
395      */
396     @JsonProperty( "current_step" )
397     public void setCurrentStep( int nCurrentStep )
398     {
399         _nCurrentStep = nCurrentStep;
400     }
401 
402     /**
403      * Set the flag to show or not details
404      * 
405      * @param bShowDetails
406      *            the flag value
407      */
408     public void setShowDetails( boolean bShowDetails )
409     {
410         _bShowDetails = bShowDetails;
411     }
412 
413     /**
414      * Return true if details can be shown otherwise false.
415      * 
416      * @return The display details flag
417      */
418     @JsonIgnore
419     public boolean getShowDetails( )
420     {
421         return _bShowDetails;
422     }
423 
424     /**
425      * @return the _lModifyDate
426      */
427     @JsonProperty( "modify_date" )
428     public long getModifyDate( )
429     {
430         return _lModifyDate;
431     }
432 
433     /**
434      * @param lModifyDate
435      *            the _lModifyDate to set
436      */
437     public void setModifyDate( long lModifyDate )
438     {
439         this._lModifyDate = lModifyDate;
440     }
441 }