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.pluginwizard.business.model;
35  
36  import java.io.Serializable;
37  import java.util.ArrayList;
38  import java.util.List;
39  
40  import javax.validation.constraints.NotEmpty;
41  import javax.validation.constraints.Pattern;
42  import javax.validation.constraints.Size;
43  
44  /**
45   * This is the business class for the object Feature
46   */
47  public class Feature implements Serializable
48  {
49      /**
50       * 
51       */
52      private static final long serialVersionUID = 1L;
53      // Variables declarations
54      private List<Integer> _nIdBusinessClasses;
55      private int _nId;
56      @NotEmpty( message = "pluginwizard.error.feature.right.notEmpty" )
57      @Pattern( regexp = "[A-Z][A-Z_]*", message = "pluginwizard.error.feature.right.pattern" )
58      private String _strFeatureRight;
59      @NotEmpty( message = "pluginwizard.error.feature.title.notEmpty" )
60      @Size( min = 6, max = 80, message = "pluginwizard.error.feature.title.size" )
61      private String _strFeatureTitle;
62      private String _strFeatureLevel;
63      @NotEmpty( message = "pluginwizard.error.feature.name.notEmpty" )
64      @Pattern( regexp = "[A-Z][a-zA-Z]*", message = "pluginwizard.error.feature.name.pattern" )
65      private String _strFeatureName;
66      @NotEmpty( message = "pluginwizard.error.feature.description.notEmpty" )
67      @Size( min = 6, max = 255, message = "pluginwizard.error.feature.description.size" )
68      private String _strFeatureDescription;
69      private String _strJspName;
70  
71      /**
72       * Constructor initializing a collection of business class
73       */
74  
75      /**
76       * Returns the Id
77       * 
78       * @return The Id
79       */
80      public int getId( )
81      {
82          return _nId;
83      }
84  
85      /**
86       * Sets the nIdFeature
87       * 
88       * @param nId
89       *            The IdFeature
90       */
91      public void setId( int nId )
92      {
93          _nId = nId;
94      }
95  
96      /**
97       * Returns the FeatureId
98       * 
99       * @return The FeatureId
100      */
101     public String getFeatureRight( )
102     {
103         return _strFeatureRight;
104     }
105 
106     /**
107      * Sets the Feature right
108      * 
109      * @param strFeatureRight
110      *            The Feature right
111      */
112     public void setFeatureRight( String strFeatureRight )
113     {
114         _strFeatureRight = strFeatureRight;
115     }
116 
117     /**
118      * Returns the FeatureTitle
119      * 
120      * @return The FeatureTitle
121      */
122     public String getFeatureTitle( )
123     {
124         return _strFeatureTitle;
125     }
126 
127     /**
128      * Sets the FeatureTitle
129      * 
130      * @param strFeatureTitle
131      *            The FeatureTitle
132      */
133     public void setFeatureTitle( String strFeatureTitle )
134     {
135         _strFeatureTitle = strFeatureTitle;
136     }
137 
138     /**
139      * Returns the FeatureLevel
140      * 
141      * @return The FeatureLevel
142      */
143     public String getFeatureLevel( )
144     {
145         return _strFeatureLevel;
146     }
147 
148     /**
149      * Sets the FeatureLevel
150      * 
151      * @param strFeatureLevel
152      *            The FeatureLevel
153      */
154     public void setFeatureLevel( String strFeatureLevel )
155     {
156         _strFeatureLevel = strFeatureLevel;
157     }
158 
159     /**
160      * Returns the Feature name
161      * 
162      * @return The Feature name
163      */
164     public String getFeatureName( )
165     {
166         return _strFeatureName;
167     }
168 
169     /**
170      * Sets the FeatureName
171      *
172      * @param strFeatureName
173      *            The Feature name
174      */
175     public void setFeatureName( String strFeatureName )
176     {
177         _strFeatureName = strFeatureName;
178     }
179 
180     /**
181      * Returns the FeatureDescription
182      * 
183      * @return The FeatureDescription
184      */
185     public String getFeatureDescription( )
186     {
187         return _strFeatureDescription;
188     }
189 
190     /**
191      * Sets the FeatureDescription
192      * 
193      * @param strFeatureDescription
194      *            The FeatureDescription
195      */
196     public void setFeatureDescription( String strFeatureDescription )
197     {
198         _strFeatureDescription = strFeatureDescription;
199     }
200 
201     /**
202      * Returns the JspName
203      * 
204      * @return The JspName
205      */
206     public String getJspName( )
207     {
208         return _strJspName;
209     }
210 
211     /**
212      * Sets the JspName
213      * 
214      * @param strJspName
215      *            The JspName
216      */
217     public void setJspName( String strJspName )
218     {
219         _strJspName = strJspName;
220     }
221 
222     /**
223      * Returns the list of IdBusinessClasses
224      * 
225      * @return the collection of IdBusinessClasses
226      */
227     public List<Integer> getIdBusinessClasses( )
228     {
229         if ( _nIdBusinessClasses != null )
230         {
231             return (List<Integer>) ( ( (ArrayList<Integer>) _nIdBusinessClasses ).clone( ) );
232         }
233         else
234         {
235             return null;
236         }
237     }
238 
239     /**
240      * Sets the list of IdBusinessClasses
241      * 
242      * @param nIdBusinessClasses
243      *            The collection of IdBusinessClasses
244      */
245     public void setIdBusinessClasses( List<Integer> nIdBusinessClasses )
246     {
247         if ( nIdBusinessClasses != null )
248         {
249             _nIdBusinessClasses = (List<Integer>) ( ( (ArrayList<Integer>) nIdBusinessClasses ).clone( ) );
250         }
251         else
252         {
253             _nIdBusinessClasses = null;
254         }
255     }
256 }