Class PackageInfo

  • All Implemented Interfaces:
    Comparable<PackageInfo>

    public class PackageInfo
    extends Object
    implements Comparable<PackageInfo>
    A package info object contains information about a package, its name, its version and the uses constraints. A package info object is immutable.
    • Constructor Detail

      • PackageInfo

        public PackageInfo​(String name,
                           String version,
                           boolean optional)
        Constructor for a package info
        Parameters:
        name - package name
        version - package version
        optional - is the package optional
      • PackageInfo

        public PackageInfo​(String name,
                           String version,
                           boolean optional,
                           Set<String> uses)
        Constructor for a package info
        Parameters:
        name - package name
        version - package version
        optional - is the package optional
        uses - Optional uses constraints
    • Method Detail

      • getName

        public String getName()
        The package name
        Returns:
        The package name
      • getVersion

        public String getVersion()
        Return the package version
        Returns:
        The package version
      • isOptional

        public boolean isOptional()
        Return whether the package is optional
        Returns:
        true if it is optional
      • getPackageVersion

        public org.osgi.framework.Version getPackageVersion()
        Return the package version as a Version object
        Returns:
        The version
      • getPackageVersionRange

        public org.osgi.framework.VersionRange getPackageVersionRange()
        Return the version as a version range
        Returns:
        The version range
      • getUses

        public Set<String> getUses()
        Return the uses constraints
        Returns:
        Optional uses constraints, might be empty
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object