Package de.mnl.osgi.bnd.maven
Class BoundRevision
- java.lang.Object
-
- de.mnl.osgi.bnd.maven.BoundRevision
-
- All Implemented Interfaces:
Comparable<BoundRevision>
public class BoundRevision extends Object implements Comparable<BoundRevision>
A revision with a reference to the maven repository in which it was found.This class resorts to a delegation pattern as second best solution, because
Revision
has only an invisible constructor and can therefore not be extended. The drawback is that the information about the repository doesn't propagate, i.e. you cannot retrieve it from an ordinaryArchive
related to thisBoundRevision
. If you need the information, you have to use aBoundArchive
instead.- See Also:
- Related bnd issue
-
-
Constructor Summary
Constructors Constructor Description BoundRevision(aQute.maven.provider.MavenBackingRepository mavenBackingRepository, aQute.maven.api.Revision revision)
Instantiates a new bound revision.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description BoundArchive
archive()
Get the default archive (extension "jar", no classifier) for this revision.BoundArchive
archive(MavenVersion version, String extension, String classifier)
Get an archive from this revision.BoundArchive
archive(String extension, String classifier)
Get a bound archive from this revision.String
artifactId()
Returns the artifact id.int
compareTo(aQute.maven.api.Revision other)
Compare to other revision.int
compareTo(BoundRevision other)
Compare to other revision.boolean
equals(Object obj)
Equals.aQute.maven.api.Archive
getPomArchive()
Gets the pom archive.String
groupId()
Returns the group id.int
hashCode()
Hash code.boolean
isSnapshot()
Checks if is snapshot.aQute.maven.provider.MavenBackingRepository
mavenBackingRepository()
Gets the maven backing repository.String
metadata()
Returns the Metadata.String
metadata(String id)
Returns the metadata for the given id.aQute.maven.api.Archive
pomArchive()
Return the pom archive.String
toString()
Returns the revision with the origin repository attached in square brackets.aQute.maven.api.Revision
unbound()
Gets the revision.MavenVersion
version()
Returns the version.
-
-
-
Constructor Detail
-
BoundRevision
public BoundRevision(aQute.maven.provider.MavenBackingRepository mavenBackingRepository, aQute.maven.api.Revision revision)
Instantiates a new bound revision.- Parameters:
mavenBackingRepository
- the maven backing repositoryrevision
- the revision
-
-
Method Detail
-
mavenBackingRepository
public final aQute.maven.provider.MavenBackingRepository mavenBackingRepository()
Gets the maven backing repository.- Returns:
- the mavenBackingRepository
-
unbound
public aQute.maven.api.Revision unbound()
Gets the revision.- Returns:
- the revision
-
artifactId
public String artifactId()
Returns the artifact id.- Returns:
- the id
-
version
public MavenVersion version()
Returns the version.- Returns:
- the version
-
isSnapshot
public boolean isSnapshot()
Checks if is snapshot.- Returns:
- true, if is snapshot
- See Also:
Revision.isSnapshot()
-
archive
public BoundArchive archive(String extension, String classifier)
Get a bound archive from this revision.- Parameters:
extension
- the archive's extension (ornull
for "jar")classifier
- the archive's classifier (ornull
for "")- Returns:
- the archive
- See Also:
Revision.archive(java.lang.String, java.lang.String)
-
archive
public BoundArchive archive()
Get the default archive (extension "jar", no classifier) for this revision.- Returns:
- the archive
- See Also:
Revision.archive(java.lang.String, java.lang.String)
-
archive
public BoundArchive archive(MavenVersion version, String extension, String classifier)
Get an archive from this revision.- Parameters:
version
- the versionextension
- the archive's extension (ornull
for "jar")classifier
- the archive's classifier (ornull
for "")- Returns:
- the archive
-
metadata
public String metadata()
Returns the Metadata.- Returns:
- the string
- See Also:
Revision.metadata()
-
metadata
public String metadata(String id)
Returns the metadata for the given id.- Parameters:
id
- the id- Returns:
- the string
- See Also:
Revision.metadata(java.lang.String)
-
toString
public String toString()
Returns the revision with the origin repository attached in square brackets.
-
pomArchive
public aQute.maven.api.Archive pomArchive()
Return the pom archive.- Returns:
- the archive
- See Also:
Revision.pomArchive()
-
getPomArchive
public aQute.maven.api.Archive getPomArchive()
Gets the pom archive.- Returns:
- the pom archive
- See Also:
Revision.getPomArchive()
-
compareTo
public int compareTo(aQute.maven.api.Revision other)
Compare to other revision. Ignores repository.- Parameters:
other
- the other- Returns:
- the int
- See Also:
Revision.compareTo(aQute.maven.api.Revision)
-
compareTo
public int compareTo(BoundRevision other)
Compare to other revision. Ignores repository.- Specified by:
compareTo
in interfaceComparable<BoundRevision>
- Parameters:
other
- the other- Returns:
- the int
- See Also:
Revision.compareTo(aQute.maven.api.Revision)
-
hashCode
public int hashCode()
Hash code. Ignores repository.
-
-