View Javadoc
1   /*
2    * Copyright (c) 2002-2020, 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.participatorybudget.business.campaign;
35  
36  import java.io.Serializable;
37  
38  import javax.validation.constraints.Min;
39  import javax.validation.constraints.Pattern;
40  import javax.validation.constraints.Size;
41  
42  import org.hibernate.validator.constraints.NotEmpty;
43  
44  /**
45   * This is the business class for the object CampaignArea
46   */
47  public class CampaignArea implements Serializable
48  {
49      private static final long serialVersionUID = 1L;
50  
51      // Variables declarations
52      private int _nId;
53  
54      @NotEmpty( message = "#i18n{participatorybudget.validation.campaignarea.CodeCampaign.notEmpty}" )
55      @Size( max = 50, message = "#i18n{participatorybudget.validation.campaignarea.CodeCampaign.size}" )
56      private String _strCodeCampaign;
57  
58      @NotEmpty( message = "#i18n{participatorybudget.validation.campaignarea.Title.notEmpty}" )
59      @Size( max = 50, message = "#i18n{participatorybudget.validation.campaignarea.Title.size}" )
60      private String _strTitle;
61  
62      @Pattern( regexp = "(whole|localized)", message = "#i18n{participatorybudget.validation.campaignarea.Type.pattern}" )
63      @NotEmpty( message = "#i18n{participatorybudget.validation.campaignarea.Type.notEmpty}" )
64      @Size( max = 50, message = "#i18n{participatorybudget.validation.campaignarea.Type.size}" )
65      private String _strType;
66  
67      @Min( value = 0, message = "#i18n{participatorybudget.validation.campaignarea.NumberVotes.min}" )
68      private int _nNumberVotes;
69  
70      private boolean _bActive;
71  
72      /**
73       * Returns the Id
74       * 
75       * @return The Id
76       */
77      public int getId( )
78      {
79          return _nId;
80      }
81  
82      /**
83       * Sets the Id
84       * 
85       * @param nId
86       *            The Id
87       */
88      public void setId( int nId )
89      {
90          _nId = nId;
91      }
92  
93      /**
94       * Returns the Id
95       * 
96       * @return The Id
97       */
98      public int getNumberVotes( )
99      {
100         return _nNumberVotes;
101     }
102 
103     /**
104      * Sets the Id
105      * 
106      * @param nId
107      *            The Id
108      */
109     public void setNumberVotes( int numberVotes )
110     {
111         _nNumberVotes = numberVotes;
112     }
113 
114     /**
115      * Returns the CodeCampaign
116      * 
117      * @return The CodeCampaign
118      */
119     public String getCodeCampaign( )
120     {
121         return _strCodeCampaign;
122     }
123 
124     /**
125      * Sets the CodeCampaign
126      * 
127      * @param strCodeCampaign
128      *            The CodeCampaign
129      */
130     public void setCodeCampaign( String strCodeCampaign )
131     {
132         _strCodeCampaign = strCodeCampaign;
133     }
134 
135     /**
136      * Returns the Title
137      * 
138      * @return The Title
139      */
140     public String getTitle( )
141     {
142         return _strTitle;
143     }
144 
145     /**
146      * Sets the Title
147      * 
148      * @param strTitle
149      *            The Title
150      */
151     public void setTitle( String strTitle )
152     {
153         _strTitle = strTitle;
154     }
155 
156     public boolean getActive( )
157     {
158         return _bActive;
159     }
160 
161     /**
162      * Sets the Active
163      * 
164      * @param bActive
165      *            The Active
166      */
167     public void setActive( boolean bActive )
168     {
169         _bActive = bActive;
170     }
171 
172     public String getType( )
173     {
174         return _strType;
175     }
176 
177     /**
178      * Sets the Type
179      * 
180      * @param strType
181      *            The Type
182      */
183     public void setType( String strType )
184     {
185         _strType = strType;
186     }
187 }