Class 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 ordinary Archive related to this BoundRevision. If you need the information, you have to use a BoundArchive instead.

    See Also:
    Related bnd issue
    • 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 repository
        revision - 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
      • groupId

        public String groupId()
        Returns the group id.
        Returns:
        the id
      • artifactId

        public String artifactId()
        Returns the artifact id.
        Returns:
        the id
      • 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 (or null for "jar")
        classifier - the archive's classifier (or null 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 version
        extension - the archive's extension (or null for "jar")
        classifier - the archive's classifier (or null 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.
        Overrides:
        toString in class Object
        Returns:
        the string representation
        See Also:
        Revision.toString()
      • 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 interface Comparable<BoundRevision>
        Parameters:
        other - the other
        Returns:
        the int
        See Also:
        Revision.compareTo(aQute.maven.api.Revision)
      • hashCode

        public int hashCode()
        Hash code. Ignores repository.
        Overrides:
        hashCode in class Object
        Returns:
        the int
        See Also:
        Revision.hashCode()
      • equals

        public boolean equals​(Object obj)
        Equals. Ignores respository.
        Overrides:
        equals in class Object
        Parameters:
        obj - the obj
        Returns:
        true, if successful
        See Also:
        Revision.equals(java.lang.Object)