View Javadoc
1   /*
2    * Copyright (c) 2002-2014, 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.workflow.modules.mappings.business;
35  
36  import org.apache.commons.lang.StringUtils;
37  
38  
39  /**
40   *
41   * CodeMappingFilter
42   *
43   */
44  public class CodeMappingFilter
45  {
46      private String _strCode;
47      private String _strLabelCode;
48      private String _strMappingTypeKey;
49      private String _strReferenceCode;
50      private boolean _bIsWideSearch;
51  
52      /**
53       * Constructor
54       */
55      public CodeMappingFilter(  )
56      {
57          _strCode = StringUtils.EMPTY;
58          _strLabelCode = StringUtils.EMPTY;
59          _strMappingTypeKey = StringUtils.EMPTY;
60          _strReferenceCode = StringUtils.EMPTY;
61      }
62  
63      /**
64       * Get the code
65       * @return the code
66       */
67      public String getCode(  )
68      {
69          return _strCode;
70      }
71  
72      /**
73       * Set the code
74       * @param code the code
75       */
76      public void setCode( String code )
77      {
78          this._strCode = code;
79      }
80  
81      /**
82       * Check if the filter contains the code
83       * @return true if it contains, false otherwise
84       */
85      public boolean containsCode(  )
86      {
87          return StringUtils.isNotBlank( _strCode );
88      }
89  
90      /**
91       * Get the label code
92       * @return the label code
93       */
94      public String getLabelCode(  )
95      {
96          return _strLabelCode;
97      }
98  
99      /**
100      * Set the label code
101      * @param labelCode the label code
102      */
103     public void setLabelCode( String labelCode )
104     {
105         this._strLabelCode = labelCode;
106     }
107 
108     /**
109      * Check if the filter contains the label code
110      * @return true if it contains, false otherwise
111      */
112     public boolean containsLabelCode(  )
113     {
114         return StringUtils.isNotBlank( _strLabelCode );
115     }
116 
117     /**
118      * Get the mapping type key
119      * @return the mapping type key
120      */
121     public String getMappingTypeKey(  )
122     {
123         return _strMappingTypeKey;
124     }
125 
126     /**
127      * Set the mapping type key
128      * @param mappingTypeKey the mapping type key
129      */
130     public void setMappingTypeKey( String mappingTypeKey )
131     {
132         this._strMappingTypeKey = mappingTypeKey;
133     }
134 
135     /**
136      * Check if the filter contains the mapping type key
137      * @return true if it contains, false otherwise
138      */
139     public boolean containsMappingTypeKey(  )
140     {
141         return StringUtils.isNotBlank( _strMappingTypeKey );
142     }
143 
144     /**
145      * Get the reference code
146      * @return the reference code
147      */
148     public String getReferenceCode(  )
149     {
150         return _strReferenceCode;
151     }
152 
153     /**
154      * Set the reference code
155      * @param referenceCode the reference code
156      */
157     public void setReferenceCode( String referenceCode )
158     {
159         this._strReferenceCode = referenceCode;
160     }
161 
162     /**
163      * Check if the filter contains the reference code
164      * @return true if the it contains, false otherwise
165      */
166     public boolean containsReferenceCode(  )
167     {
168         return StringUtils.isNotBlank( _strReferenceCode );
169     }
170 
171     /**
172      * Set true if the search is wide, false otherwise
173      * @param isWideSearch true if the search is wide, false otherwise
174      */
175     public void setWideSearch( boolean isWideSearch )
176     {
177         this._bIsWideSearch = isWideSearch;
178     }
179 
180     /**
181      * Return true if the search is wide, false otherwise
182      * @return true if the search is wide, false otherwise
183      */
184     public boolean isWideSearch(  )
185     {
186         return _bIsWideSearch;
187     }
188 }