org.eclipse.osgi.service.resolver
Interface VersionConstraint

All Superinterfaces:
java.lang.Cloneable
All Known Subinterfaces:
BundleSpecification, GenericSpecification, HostSpecification, ImportPackageSpecification

public interface VersionConstraint
extends java.lang.Cloneable

VersionConstraints represent the relationship between two bundles (in the case of bundle requires) or a bundle and a package (in the case of import/export).

Clients may implement this interface.

Since:
3.1

Method Summary
 BundleDescription getBundle()
          Returns the bundle that declares this constraint.
 java.lang.String getName()
          Returns this constraint's name.
 BaseDescription getSupplier()
          Returns the supplier that satisfies this constraint, if it is resolved.
 VersionRange getVersionRange()
          Returns the version range for this constraint.
 boolean isResolved()
          Returns whether this constraint is resolved.
 boolean isSatisfiedBy(BaseDescription supplier)
          Returns whether this constraint could be satisfied by the given supplier.
 

Method Detail

getName

java.lang.String getName()
Returns this constraint's name.

Returns:
this constraint's name

getVersionRange

VersionRange getVersionRange()
Returns the version range for this constraint.

Returns:
the version range for this constraint, or null

getBundle

BundleDescription getBundle()
Returns the bundle that declares this constraint.

Returns:
a bundle description

isResolved

boolean isResolved()
Returns whether this constraint is resolved. A resolved constraint is guaranteed to have its supplier defined.

Returns:
true if this bundle is resolved, false otherwise

isSatisfiedBy

boolean isSatisfiedBy(BaseDescription supplier)
Returns whether this constraint could be satisfied by the given supplier. This will depend on the suppliers different attributes including its name, versions and other arbitrary attributes

Parameters:
supplier - a supplier to be tested against this constraint (may be null)
Returns:
true if this constraint could be resolved using the supplier, false otherwise

getSupplier

BaseDescription getSupplier()
Returns the supplier that satisfies this constraint, if it is resolved.

Returns:
a supplier, or null
See Also:
isResolved()