1 package org.apache.archiva.indexer.search;
4 * Licensed to the Apache Software Foundation (ASF) under one
5 * or more contributor license agreements. See the NOTICE file
6 * distributed with this work for additional information
7 * regarding copyright ownership. The ASF licenses this file
8 * to you under the Apache License, Version 2.0 (the
9 * "License"); you may not use this file except in compliance
10 * with the License. You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing,
15 * software distributed under the License is distributed on an
16 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17 * KIND, either express or implied. See the License for the
18 * specific language governing permissions and limitations
22 import java.util.ArrayList;
23 import java.util.List;
28 * @version $Id: SearchResultHit.java 740552 2009-02-04 01:09:17Z oching $
30 public class SearchResultHit
32 // The (optional) context for this result.
33 private String context;
35 // Basic hit, direct to non-artifact resource.
38 // Advanced hit, reference to groupId.
39 private String groupId;
41 // Advanced hit, reference to artifactId.
42 private String artifactId;
44 // TODO: remove/deprecate this field!
45 private String version = "";
47 private String repositoryId = "";
49 private List<String> versions = new ArrayList<String>();
53 * contains osgi metadata Bundle-Version if available
57 private String bundleVersion;
60 * contains osgi metadata Bundle-SymbolicName if available
64 private String bundleSymbolicName;
67 * contains osgi metadata Export-Package if available
71 private String bundleExportPackage;
74 * contains osgi metadata Export-Service if available
78 private String bundleExportService;
80 public String getContext()
85 public void setContext( String context )
87 this.context = context;
90 public String getUrl()
95 public void setUrl( String url )
100 public String getUrlFilename()
102 return this.url.substring( this.url.lastIndexOf( '/' ) );
105 public String getArtifactId()
110 public void setArtifactId( String artifactId )
112 this.artifactId = artifactId;
115 public String getGroupId()
120 public void setGroupId( String groupId )
122 this.groupId = groupId;
125 public String getVersion()
130 public void setVersion(String version)
132 this.version = version;
135 public List<String> getVersions()
140 public void setVersions(List<String> versions)
142 this.versions = versions;
145 public String getRepositoryId()
150 public void setRepositoryId( String repositoryId )
152 this.repositoryId = repositoryId;
155 public void addVersion( String version )
157 versions.add( version );
160 public String getBundleVersion()
162 return bundleVersion;
165 public void setBundleVersion( String bundleVersion )
167 this.bundleVersion = bundleVersion;
170 public String getBundleSymbolicName()
172 return bundleSymbolicName;
175 public void setBundleSymbolicName( String bundleSymbolicName )
177 this.bundleSymbolicName = bundleSymbolicName;
180 public String getBundleExportPackage()
182 return bundleExportPackage;
185 public void setBundleExportPackage( String bundleExportPackage )
187 this.bundleExportPackage = bundleExportPackage;
190 public String getBundleExportService()
192 return bundleExportService;
195 public void setBundleExportService( String bundleExportService )
197 this.bundleExportService = bundleExportService;
201 public String toString()
203 return "SearchResultHit{" + "context='" + context + '\'' + ", url='" + url + '\'' + ", groupId='" + groupId
204 + '\'' + ", artifactId='" + artifactId + '\'' + ", version='" + version + '\'' + ", repositoryId='"
205 + repositoryId + '\'' + ", versions=" + versions + ", bundleVersion='" + bundleVersion + '\''
206 + ", bundleSymbolicName='" + bundleSymbolicName + '\'' + ", bundleExportPackage='" + bundleExportPackage
207 + '\'' + ", bundleExportService='" + bundleExportService + '\'' + '}';