This project has retired. For details please refer to its Attic page.
Source code
001package org.apache.archiva.indexer.search;
002
003import java.util.ArrayList;
004import java.util.List;
005
006/*
007 * Licensed to the Apache Software Foundation (ASF) under one
008 * or more contributor license agreements.  See the NOTICE file
009 * distributed with this work for additional information
010 * regarding copyright ownership.  The ASF licenses this file
011 * to you under the Apache License, Version 2.0 (the
012 * "License"); you may not use this file except in compliance
013 * with the License.  You may obtain a copy of the License at
014 *
015 *  http://www.apache.org/licenses/LICENSE-2.0
016 *
017 * Unless required by applicable law or agreed to in writing,
018 * software distributed under the License is distributed on an
019 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
020 * KIND, either express or implied.  See the License for the
021 * specific language governing permissions and limitations
022 * under the License.
023 */
024
025public class SearchFields
026{
027    /**
028     * groupId
029     */
030    private String groupId;
031
032    /**
033     * artifactId
034     */
035    private String artifactId;
036
037    /**
038     * version
039     */
040    private String version;
041
042    /**
043     * packaging (jar, war, pom, etc.)
044     */
045    private String packaging;
046
047    /**
048     * class name or package name
049     */
050    private String className;
051
052    /**
053     * repositories
054     */
055    private List<String> repositories = new ArrayList<>();
056
057
058    /**
059     * contains osgi metadata Bundle-Version if available
060     *
061     * @since 1.4-M1
062     */
063    private String bundleVersion;
064
065    /**
066     * contains osgi metadata Bundle-SymbolicName if available
067     *
068     * @since 1.4-M1
069     */
070    private String bundleSymbolicName;
071
072    /**
073     * contains osgi metadata Export-Package if available
074     *
075     * @since 1.4-M1
076     */
077    private String bundleExportPackage;
078
079    /**
080     * contains osgi metadata import package if available
081     *
082     * @since 1.4-M1
083     */
084    private String bundleImportPackage;
085
086    /**
087     * contains osgi metadata name if available
088     *
089     * @since 1.4-M1
090     */
091    private String bundleName;
092
093    /**
094     * contains osgi metadata Export-Service if available
095     *
096     * @since 1.4-M1
097     */
098    private String bundleExportService;
099
100
101    /**
102     * contains osgi metadata Require-Bundle if available
103     *
104     * @since 1.4-M3
105     */
106    private String bundleRequireBundle;
107
108    /**
109     * not return artifact with file extension pom
110     *
111     * @since 1.4-M2
112     */
113    private boolean includePomArtifacts = false;
114
115    private String classifier;
116
117    /**
118     * we use exact String matching search
119     *
120     * @since 2.1.0
121     */
122    private boolean exactSearch = false;
123
124    public SearchFields()
125    {
126        // no op
127    }
128
129    public SearchFields( String groupId, String artifactId, String version, String packaging, String className,
130                         List<String> repositories )
131    {
132        this.groupId = groupId;
133        this.artifactId = artifactId;
134        this.version = version;
135        this.packaging = packaging;
136        this.className = className;
137        this.repositories = repositories;
138    }
139
140    public String getGroupId()
141    {
142        return groupId;
143    }
144
145    public void setGroupId( String groupId )
146    {
147        this.groupId = groupId;
148    }
149
150    public String getArtifactId()
151    {
152        return artifactId;
153    }
154
155    public void setArtifactId( String artifactId )
156    {
157        this.artifactId = artifactId;
158    }
159
160    public String getVersion()
161    {
162        return version;
163    }
164
165    public void setVersion( String version )
166    {
167        this.version = version;
168    }
169
170    public String getPackaging()
171    {
172        return packaging;
173    }
174
175    public void setPackaging( String packaging )
176    {
177        this.packaging = packaging;
178    }
179
180    public String getClassName()
181    {
182        return className;
183    }
184
185    public void setClassName( String className )
186    {
187        this.className = className;
188    }
189
190    public List<String> getRepositories()
191    {
192        return repositories;
193    }
194
195    public void setRepositories( List<String> repositories )
196    {
197        this.repositories = repositories;
198    }
199
200
201    public String getBundleVersion()
202    {
203        return bundleVersion;
204    }
205
206    public void setBundleVersion( String bundleVersion )
207    {
208        this.bundleVersion = bundleVersion;
209    }
210
211    public String getBundleSymbolicName()
212    {
213        return bundleSymbolicName;
214    }
215
216    public void setBundleSymbolicName( String bundleSymbolicName )
217    {
218        this.bundleSymbolicName = bundleSymbolicName;
219    }
220
221    public String getBundleExportPackage()
222    {
223        return bundleExportPackage;
224    }
225
226    public void setBundleExportPackage( String bundleExportPackage )
227    {
228        this.bundleExportPackage = bundleExportPackage;
229    }
230
231    public String getBundleExportService()
232    {
233        return bundleExportService;
234    }
235
236    public void setBundleExportService( String bundleExportService )
237    {
238        this.bundleExportService = bundleExportService;
239    }
240
241    public String getClassifier()
242    {
243        return classifier;
244    }
245
246    public void setClassifier( String classifier )
247    {
248        this.classifier = classifier;
249    }
250
251    public String getBundleImportPackage()
252    {
253        return bundleImportPackage;
254    }
255
256    public void setBundleImportPackage( String bundleImportPackage )
257    {
258        this.bundleImportPackage = bundleImportPackage;
259    }
260
261    public String getBundleName()
262    {
263        return bundleName;
264    }
265
266    public void setBundleName( String bundleName )
267    {
268        this.bundleName = bundleName;
269    }
270
271    public boolean isIncludePomArtifacts()
272    {
273        return includePomArtifacts;
274    }
275
276    public void setIncludePomArtifacts( boolean includePomArtifacts )
277    {
278        this.includePomArtifacts = includePomArtifacts;
279    }
280
281    public String getBundleRequireBundle()
282    {
283        return bundleRequireBundle;
284    }
285
286    public void setBundleRequireBundle( String bundleRequireBundle )
287    {
288        this.bundleRequireBundle = bundleRequireBundle;
289    }
290
291    public boolean isExactSearch()
292    {
293        return exactSearch;
294    }
295
296    public void setExactSearch( boolean exactSearch )
297    {
298        this.exactSearch = exactSearch;
299    }
300
301    @Override
302    public String toString()
303    {
304        final StringBuilder sb = new StringBuilder();
305        sb.append( "SearchFields" );
306        sb.append( "{groupId='" ).append( groupId ).append( '\'' );
307        sb.append( ", artifactId='" ).append( artifactId ).append( '\'' );
308        sb.append( ", version='" ).append( version ).append( '\'' );
309        sb.append( ", packaging='" ).append( packaging ).append( '\'' );
310        sb.append( ", className='" ).append( className ).append( '\'' );
311        sb.append( ", repositories=" ).append( repositories );
312        sb.append( ", bundleVersion='" ).append( bundleVersion ).append( '\'' );
313        sb.append( ", bundleSymbolicName='" ).append( bundleSymbolicName ).append( '\'' );
314        sb.append( ", bundleExportPackage='" ).append( bundleExportPackage ).append( '\'' );
315        sb.append( ", bundleImportPackage='" ).append( bundleImportPackage ).append( '\'' );
316        sb.append( ", bundleName='" ).append( bundleName ).append( '\'' );
317        sb.append( ", bundleExportService='" ).append( bundleExportService ).append( '\'' );
318        sb.append( ", bundleRequireBundle='" ).append( bundleRequireBundle ).append( '\'' );
319        sb.append( ", includePomArtifacts=" ).append( includePomArtifacts );
320        sb.append( ", classifier='" ).append( classifier ).append( '\'' );
321        sb.append( '}' );
322        return sb.toString();
323    }
324}