Class PackageInfo
java.lang.Object
org.apache.sling.feature.scanner.PackageInfo
- All Implemented Interfaces:
Comparable<PackageInfo>
A package info object contains information about a package, its name, its
version and the uses constraints. For example, it is used to return
the information about bundle exports and imports.
A package info object is immutable.
-
Constructor Summary
ConstructorsConstructorDescriptionPackageInfo(String name, String version, boolean optional) Constructor for a package infoPackageInfo(String name, String version, boolean optional, Set<String> uses) Constructor for a package info -
Method Summary
Modifier and TypeMethodDescriptionintbooleangetName()The package nameorg.osgi.framework.VersionReturn the package version as aVersionobject.org.osgi.framework.VersionRangeReturn the version as a version range If this package info is used to return info about an export package statement, don't use this method but rather usegetPackageVersion()getUses()Return the uses constraintsReturn the package versioninthashCode()booleanReturn whether the package is optionaltoString()
-
Constructor Details
-
PackageInfo
-
PackageInfo
-
-
Method Details
-
getName
-
getVersion
-
isOptional
public boolean isOptional()Return whether the package is optional- Returns:
trueif it is optional
-
getPackageVersion
public org.osgi.framework.Version getPackageVersion()Return the package version as aVersionobject. If this package info is used to return info about an import package statement, don't use this method but rather usegetPackageVersionRange()- Returns:
- The version or
null - Throws:
IllegalArgumentException- If the version is not well formed.
-
getPackageVersionRange
public org.osgi.framework.VersionRange getPackageVersionRange()Return the version as a version range If this package info is used to return info about an export package statement, don't use this method but rather usegetPackageVersion()- Returns:
- The version range or
null - Throws:
IllegalArgumentException- If the range is not well formed.
-
getUses
-
toString
-
compareTo
- Specified by:
compareToin interfaceComparable<PackageInfo>
-
hashCode
-
equals
-