View Javadoc
1   /*
2    * Copyright (c) 2002-2019, 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.cgu.business;
35  
36  import java.io.Serializable;
37  
38  import org.hibernate.validator.constraints.NotEmpty;
39  
40  /**
41   * This is the business class for the object CguVersion
42   */
43  public class CguVersion implements Serializable
44  {
45      private static final long serialVersionUID = 1L;
46  
47      // Variables declarations
48      private int _nId;
49      private int _nCguId;
50      @NotEmpty( message = "#i18n{cgu.validation.cgu.Texte.notEmpty}" )
51      private String _strText;
52      private int _nVersion;
53      private boolean _bPublished;
54      private int _nMinimumAge;
55  
56      /**
57       * cguVersion constructor
58       */
59      public CguVersion( )
60      {
61          super( );
62          _nVersion = 1;
63          _bPublished = false;
64      }
65  
66      /**
67       * Returns the Id
68       * 
69       * @return The Id
70       */
71      public int getId( )
72      {
73          return _nId;
74      }
75  
76      /**
77       * Sets the Id
78       * 
79       * @param nId
80       *            The Id
81       */
82      public void setId( int nId )
83      {
84          this._nId = nId;
85      }
86  
87      /**
88       * @return the _nCguId
89       */
90      public int getCguId( )
91      {
92          return _nCguId;
93      }
94  
95      /**
96       * @param nCguId
97       *            the _nCguId to set
98       */
99      public void setCguId( int nCguId )
100     {
101         this._nCguId = nCguId;
102     }
103 
104     /**
105      * Returns the Text
106      * 
107      * @return The Text
108      */
109     public String getText( )
110     {
111         return _strText;
112     }
113 
114     /**
115      * Sets the Text
116      * 
117      * @param strText
118      *            The Text
119      */
120     public void setText( String strText )
121     {
122         _strText = strText;
123     }
124 
125     /**
126      * Returns the Version
127      * 
128      * @return The Version
129      */
130     public int getVersion( )
131     {
132         return _nVersion;
133     }
134 
135     /**
136      * Sets the Version
137      * 
138      * @param strVersion
139      *            The Version
140      */
141     public void setVersion( int strVersion )
142     {
143         _nVersion = strVersion;
144     }
145 
146     /**
147      * check if the CGU is published.
148      * 
149      * @return true if the cGU is published
150      */
151     public boolean isPublished( )
152     {
153         return _bPublished;
154     }
155 
156     /**
157      * set true if the CGU is published
158      * 
159      * @param bPublished
160      *            true if the CGU is published
161      */
162     public void setPublished( boolean bPublished )
163     {
164         this._bPublished = bPublished;
165     }
166 
167     /**
168      * @return the minimumAge
169      */
170     public int getMinimumAge( )
171     {
172         return _nMinimumAge;
173     }
174 
175     /**
176      * @param nMinimumAge
177      *            the minimumAge to set
178      */
179     public void setMinimumAge( int nMinimumAge )
180     {
181         this._nMinimumAge = nMinimumAge;
182     }
183 }