public class VersionPackageConstraint extends PackageConstraint
Modifier and Type | Class and Description |
---|---|
static class |
VersionPackageConstraint.VersionComparison
Enumeration encapsulating version comparison operations
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
VERSION_KEY
The meta data key for the version number
|
Constructor and Description |
---|
VersionPackageConstraint(Package p) |
Modifier and Type | Method and Description |
---|---|
boolean |
checkConstraint(Package target)
Check the target package against the constraint embodied in this
PackageConstraint.
|
PackageConstraint |
checkConstraint(PackageConstraint target)
Check the target package constraint against the constraint embodied in this
package constraint.
|
static VersionPackageConstraint.VersionComparison |
compare(java.lang.String version1,
java.lang.String version2)
Returns a VersionComparison that represents the comparison between the
supplied version 1 and version 2.
|
VersionPackageConstraint.VersionComparison |
getVersionComparison() |
void |
setVersionConstraint(java.lang.String constraint) |
void |
setVersionConstraint(VersionPackageConstraint.VersionComparison c) |
java.lang.String |
toString() |
getPackage, setPackage
public static java.lang.String VERSION_KEY
public VersionPackageConstraint(Package p)
public static VersionPackageConstraint.VersionComparison compare(java.lang.String version1, java.lang.String version2)
version1
- String containing version number 1.version2
- String containing version number 2.public void setVersionConstraint(VersionPackageConstraint.VersionComparison c)
public VersionPackageConstraint.VersionComparison getVersionComparison()
public void setVersionConstraint(java.lang.String constraint)
public PackageConstraint checkConstraint(PackageConstraint target) throws java.lang.Exception
checkConstraint
in class PackageConstraint
target
- the package constraint to compare againstjava.lang.Exception
public boolean checkConstraint(Package target) throws java.lang.Exception
checkConstraint
in class PackageConstraint
target
- a package to check with respect to the encapsulated package
and the constraint.java.lang.Exception
- if the constraint can't be checked for some reason.public java.lang.String toString()
toString
in class java.lang.Object