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.portal.business.regularexpression;
35  
36  /**
37   *
38   * RegularExpression
39   *
40   */
41  public class RegularExpression
42  {
43      private int _nIdExpression;
44      private String _strTitle;
45      private String _strValue;
46      private String _strInformationMessage;
47      private String _strErrorMessage;
48      private String _strValidExemple;
49  
50      /**
51       * return the id of the regular expression
52       * 
53       * @return the id of the regular expression
54       */
55      public int getIdExpression( )
56      {
57          return _nIdExpression;
58      }
59  
60      /**
61       * set the id of the regular expression
62       * 
63       * @param idExpression
64       *            the id of the regular expression
65       */
66      public void setIdExpression( int idExpression )
67      {
68          _nIdExpression = idExpression;
69      }
70  
71      /**
72       * return the error message
73       * 
74       * @return the error message
75       */
76      public String getErrorMessage( )
77      {
78          return _strErrorMessage;
79      }
80  
81      /**
82       * set the error message
83       * 
84       * @param errorMessage
85       *            the error message
86       */
87      public void setErrorMessage( String errorMessage )
88      {
89          _strErrorMessage = errorMessage;
90      }
91  
92      /**
93       *
94       * return a valid exemple which is validate by the regular expression
95       * 
96       * @return a valid exemple
97       */
98      public String getValidExemple( )
99      {
100         return _strValidExemple;
101     }
102 
103     /**
104      * set a valid exemple which is validate by the regular expression
105      * 
106      * @param exempleValide
107      *            a valid exemple
108      */
109     public void setValidExemple( String exempleValide )
110     {
111         _strValidExemple = exempleValide;
112     }
113 
114     /**
115      * return the information message
116      * 
117      * @return the information message
118      */
119     public String getInformationMessage( )
120     {
121         return _strInformationMessage;
122     }
123 
124     /**
125      * set the information message
126      * 
127      * @param informationMessage
128      *            the information message
129      */
130     public void setInformationMessage( String informationMessage )
131     {
132         _strInformationMessage = informationMessage;
133     }
134 
135     /**
136      * return the title of the regular expression
137      * 
138      * @return the title of the regular expression
139      */
140     public String getTitle( )
141     {
142         return _strTitle;
143     }
144 
145     /**
146      * set the title of the regular expression
147      * 
148      * @param title
149      *            the title of the regular expression
150      */
151     public void setTitle( String title )
152     {
153         _strTitle = title;
154     }
155 
156     /**
157      * return the value of the regular expression
158      * 
159      * @return the value of the regular expression
160      */
161     public String getValue( )
162     {
163         return _strValue;
164     }
165 
166     /**
167      * set the value of the regular expression
168      * 
169      * @param value
170      *            the value of the regular expression
171      */
172     public void setValue( String value )
173     {
174         _strValue = value;
175     }
176 
177     /**
178      * @param obj
179      *            the object to compare
180      * @return true if the regularExpression in parameter is the same regularExpression
181      */
182     public boolean equals( Object obj )
183     {
184         return obj instanceof RegularExpression/fr/paris/lutece/portal/business/regularexpression/RegularExpression.html#RegularExpression">RegularExpression && ( ( (RegularExpression) obj ).getIdExpression( ) == _nIdExpression );
185     }
186 
187     /**
188      * @return the id of the expression
189      */
190     public int hashCode( )
191     {
192         return _nIdExpression;
193     }
194 }