1 /*
2 * Copyright (c) 2002-2021, 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.announce.business;
35
36 import fr.paris.lutece.portal.service.rbac.RBACResource;
37
38 import java.util.Collection;
39
40 /**
41 * Sector
42 */
43 public class Sector implements RBACResource
44 {
45 /**
46 */
47 public static final String RESOURCE_TYPE = "SECTOR";
48
49 // ///////////////////////////////////////////////////////////////////////////////
50 // Constants
51 private int _nId;
52 private String _strLabel;
53 private String _strDescription;
54 private int _nNumberCategories;
55 private Collection<Category> _listCategories;
56 private boolean _bAnnouncesValidation;
57 private int _nOrder;
58 private int _nNumberAnnounces;
59 private String _strTags;
60
61 /**
62 * gets the id of sector
63 *
64 * @return the sector id
65 */
66 public int getId( )
67 {
68 return _nId;
69 }
70
71 /**
72 * sets the id of sector
73 *
74 * @param nId
75 * the sector id
76 */
77 public void setId( int nId )
78 {
79 _nId = nId;
80 }
81
82 /**
83 * gets the label of sector
84 *
85 * @return gets the label of sector
86 */
87 public String getLabel( )
88 {
89 return _strLabel;
90 }
91
92 /**
93 * sets the label of sector
94 *
95 * @param strLabel
96 * the label of sector
97 */
98 public void setLabel( String strLabel )
99 {
100 _strLabel = strLabel;
101 }
102
103 /**
104 * gets the description of sector
105 *
106 * @return the description of sector
107 */
108 public String getDescription( )
109 {
110 return _strDescription;
111 }
112
113 /**
114 * gets the description of sector
115 *
116 * @param strDescription
117 * the description of sector
118 */
119 public void setDescription( String strDescription )
120 {
121 _strDescription = strDescription;
122 }
123
124 /**
125 * gets the number of categories for the sector
126 *
127 * @return the number of categories for the sector
128 */
129 public int getNumberCategories( )
130 {
131 return _nNumberCategories;
132 }
133
134 /**
135 * sets the number of categories for the sector
136 *
137 * @param nNumberCategories
138 * the number of categories for the sector
139 */
140 public void setNumberCategories( int nNumberCategories )
141 {
142 _nNumberCategories = nNumberCategories;
143 }
144
145 /**
146 * gets the list of categories of the sector
147 *
148 * @return the list of categories of the sector
149 */
150 public Collection<Category> getListCategories( )
151 {
152 return _listCategories;
153 }
154
155 /**
156 * sets the list of categories of the sector
157 *
158 * @param listCategories
159 * the list of categories of the sector
160 */
161 public void setListCategories( Collection<Category> listCategories )
162 {
163 _listCategories = listCategories;
164 }
165
166 /**
167 * gets weather or not the announces of the filed must be moderated
168 *
169 * @return weather or not the announces of the filed must be moderated
170 */
171 public boolean getAnnouncesValidation( )
172 {
173 return _bAnnouncesValidation;
174 }
175
176 /**
177 * sets weather or not the announces of the filed must be moderated
178 *
179 * @param bAnnouncesValidation
180 * weather or not the announces of the filed must be moderated
181 */
182 public void setAnnouncesValidation( boolean bAnnouncesValidation )
183 {
184 _bAnnouncesValidation = bAnnouncesValidation;
185 }
186
187 /**
188 * {@inheritDoc}
189 */
190 @Override
191 public String getResourceId( )
192 {
193 return Integer.toString( getId( ) );
194 }
195
196 /**
197 * {@inheritDoc}
198 */
199 @Override
200 public String getResourceTypeCode( )
201 {
202 return RESOURCE_TYPE;
203 }
204
205 /**
206 * Get the order of the announce
207 *
208 * @return The order of the announce
209 */
210 public int getOrder( )
211 {
212 return _nOrder;
213 }
214
215 /**
216 * Set the order of the announce
217 *
218 * @param nOrder
219 * The order of the announce
220 */
221 public void setOrder( int nOrder )
222 {
223 this._nOrder = nOrder;
224 }
225
226 /**
227 * Get the number of announces
228 *
229 * @return The number of announces
230 */
231 public int getNumberAnnounces( )
232 {
233 return _nNumberAnnounces;
234 }
235
236 /**
237 * Set the number of announces
238 *
239 * @param nNumberAnnounces
240 * The number of announces
241 */
242 public void setNumberAnnounces( int nNumberAnnounces )
243 {
244 this._nNumberAnnounces = nNumberAnnounces;
245 }
246
247 /**
248 * gets the tags of sector
249 *
250 * @return gets the tags of sector
251 */
252 public String getTags( )
253 {
254 return _strTags;
255 }
256
257 /**
258 * sets the Tags of sector
259 *
260 * @param strTags
261 * the Tags of sector
262 */
263 public void setTags( String strTags )
264 {
265 _strTags = strTags;
266 }
267 }