1 package org.apache.archiva.rest.api.model;
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 javax.xml.bind.annotation.XmlRootElement;
23 import java.io.Serializable;
24 import java.util.List;
26 @XmlRootElement( name = "artifact" )
28 implements Serializable
30 // The (optional) context for this result.
31 private String context;
33 // Basic hit, direct to non-artifact resource.
36 // Advanced hit, reference to groupId.
37 private String groupId;
39 // Advanced hit, reference to artifactId.
40 private String artifactId;
42 private String repositoryId;
44 private String version;
47 * Plugin goal prefix (only if packaging is "maven-plugin")
49 private String prefix;
52 * Plugin goals (only if packaging is "maven-plugin")
54 private List<String> goals;
57 * contains osgi metadata Bundle-Version if available
61 private String bundleVersion;
64 * contains osgi metadata Bundle-SymbolicName if available
68 private String bundleSymbolicName;
71 * contains osgi metadata Export-Package if available
75 private String bundleExportPackage;
78 * contains osgi metadata Export-Service if available
82 private String bundleExportService;
85 * contains osgi metadata Bundle-Description if available
89 private String bundleDescription;
92 * contains osgi metadata Bundle-Name if available
96 private String bundleName;
99 * contains osgi metadata Bundle-License if available
103 private String bundleLicense;
106 * contains osgi metadata Bundle-DocURL if available
110 private String bundleDocUrl;
113 * contains osgi metadata Import-Package if available
117 private String bundleImportPackage;
120 * contains osgi metadata Require-Bundle if available
124 private String bundleRequireBundle;
126 private String classifier;
128 private String packaging;
131 * file extension of the artifact
135 private String fileExtension;
138 * human readable size : not available for all services
160 public Artifact( String groupId, String artifactId, String version )
162 this.artifactId = artifactId;
163 this.groupId = groupId;
164 this.version = version;
167 public String getGroupId()
172 public String getArtifactId()
177 public String getVersion()
182 public String getRepositoryId()
187 public void setGroupId( String groupId )
189 this.groupId = groupId;
192 public void setArtifactId( String artifactId )
194 this.artifactId = artifactId;
197 public void setVersion( String version )
199 this.version = version;
202 public void setRepositoryId( String repositoryId )
204 this.repositoryId = repositoryId;
207 public String getContext()
212 public void setContext( String context )
214 this.context = context;
217 public String getUrl()
222 public void setUrl( String url )
227 public String getPrefix()
232 public void setPrefix( String prefix )
234 this.prefix = prefix;
237 public List<String> getGoals()
242 public void setGoals( List<String> goals )
247 public String getBundleVersion()
249 return bundleVersion;
252 public void setBundleVersion( String bundleVersion )
254 this.bundleVersion = bundleVersion;
257 public String getBundleSymbolicName()
259 return bundleSymbolicName;
262 public void setBundleSymbolicName( String bundleSymbolicName )
264 this.bundleSymbolicName = bundleSymbolicName;
267 public String getBundleExportPackage()
269 return bundleExportPackage;
272 public void setBundleExportPackage( String bundleExportPackage )
274 this.bundleExportPackage = bundleExportPackage;
277 public String getBundleExportService()
279 return bundleExportService;
282 public void setBundleExportService( String bundleExportService )
284 this.bundleExportService = bundleExportService;
287 public String getBundleDescription()
289 return bundleDescription;
292 public void setBundleDescription( String bundleDescription )
294 this.bundleDescription = bundleDescription;
297 public String getBundleName()
302 public void setBundleName( String bundleName )
304 this.bundleName = bundleName;
307 public String getBundleLicense()
309 return bundleLicense;
312 public void setBundleLicense( String bundleLicense )
314 this.bundleLicense = bundleLicense;
317 public String getBundleDocUrl()
322 public void setBundleDocUrl( String bundleDocUrl )
324 this.bundleDocUrl = bundleDocUrl;
327 public String getBundleImportPackage()
329 return bundleImportPackage;
332 public void setBundleImportPackage( String bundleImportPackage )
334 this.bundleImportPackage = bundleImportPackage;
337 public String getBundleRequireBundle()
339 return bundleRequireBundle;
342 public void setBundleRequireBundle( String bundleRequireBundle )
344 this.bundleRequireBundle = bundleRequireBundle;
347 public String getClassifier()
352 public void setClassifier( String classifier )
354 this.classifier = classifier;
358 public String getPackaging()
363 public void setPackaging( String packaging )
365 this.packaging = packaging;
368 public String getFileExtension()
370 return fileExtension;
373 public void setFileExtension( String fileExtension )
375 this.fileExtension = fileExtension;
378 public String getSize()
383 public void setSize( String size )
388 public String getType()
393 public void setType( String type )
398 public String getPath()
403 public void setPath( String path )
409 public String toString()
411 final StringBuilder sb = new StringBuilder();
412 sb.append( "Artifact" );
413 sb.append( "{context='" ).append( context ).append( '\'' );
414 sb.append( ", url='" ).append( url ).append( '\'' );
415 sb.append( ", groupId='" ).append( groupId ).append( '\'' );
416 sb.append( ", artifactId='" ).append( artifactId ).append( '\'' );
417 sb.append( ", repositoryId='" ).append( repositoryId ).append( '\'' );
418 sb.append( ", version='" ).append( version ).append( '\'' );
419 sb.append( ", prefix='" ).append( prefix ).append( '\'' );
420 sb.append( ", goals=" ).append( goals );
421 sb.append( ", bundleVersion='" ).append( bundleVersion ).append( '\'' );
422 sb.append( ", bundleSymbolicName='" ).append( bundleSymbolicName ).append( '\'' );
423 sb.append( ", bundleExportPackage='" ).append( bundleExportPackage ).append( '\'' );
424 sb.append( ", bundleExportService='" ).append( bundleExportService ).append( '\'' );
425 sb.append( ", bundleDescription='" ).append( bundleDescription ).append( '\'' );
426 sb.append( ", bundleName='" ).append( bundleName ).append( '\'' );
427 sb.append( ", bundleLicense='" ).append( bundleLicense ).append( '\'' );
428 sb.append( ", bundleDocUrl='" ).append( bundleDocUrl ).append( '\'' );
429 sb.append( ", bundleImportPackage='" ).append( bundleImportPackage ).append( '\'' );
430 sb.append( ", bundleRequireBundle='" ).append( bundleRequireBundle ).append( '\'' );
431 sb.append( ", classifier='" ).append( classifier ).append( '\'' );
432 sb.append( ", packaging='" ).append( packaging ).append( '\'' );
433 sb.append( ", fileExtension='" ).append( fileExtension ).append( '\'' );
434 sb.append( ", size='" ).append( size ).append( '\'' );
435 sb.append( ", type='" ).append( type ).append( '\'' );
436 sb.append( ", path='" ).append( path ).append( '\'' );
438 return sb.toString();