Interface VersionConstraint
-
- All Superinterfaces:
Cloneable
- All Known Subinterfaces:
BundleSpecification,GenericSpecification,HostSpecification,ImportPackageSpecification,NativeCodeSpecification
public interface VersionConstraint extends 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).This interface is not intended to be implemented by clients. The
StateObjectFactoryshould be used to construct instances.- Since:
- 3.1
- Restriction:
- This interface is not intended to be implemented by clients.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description BundleDescriptiongetBundle()Returns the bundle that declares this constraint.StringgetName()Returns this constraint's name.BundleRequirementgetRequirement()Returns the requirement represented by this constraint.BaseDescriptiongetSupplier()Returns the supplier that satisfies this constraint, if it is resolved.ObjectgetUserObject()Returns the user object associated to this constraint, ornullif none exists.VersionRangegetVersionRange()Returns the version range for this constraint.booleanisResolved()Returns whether this constraint is resolved.booleanisSatisfiedBy(BaseDescription supplier)Returns whether this constraint could be satisfied by the given supplier.voidsetUserObject(Object userObject)Associates a user-provided object to this constraint, or removes an existing association, ifnullis provided.
-
-
-
Method Detail
-
getName
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:
trueif this bundle is resolved,falseotherwise
-
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 benull)- Returns:
trueif this constraint could be resolved using the supplier,falseotherwise
-
getSupplier
BaseDescription getSupplier()
Returns the supplier that satisfies this constraint, if it is resolved.- Returns:
- a supplier, or
null - See Also:
isResolved()
-
getRequirement
BundleRequirement getRequirement()
Returns the requirement represented by this constraint. Some constraint types may not be able to represent a requirement. In such casesnullis returned.- Returns:
- the requirement represented by this constraint
- Since:
- 3.7
-
getUserObject
Object getUserObject()
Returns the user object associated to this constraint, ornullif none exists.- Returns:
- the user object associated to this constraint,
or
null - Since:
- 3.8
-
setUserObject
void setUserObject(Object userObject)
Associates a user-provided object to this constraint, or removes an existing association, ifnullis provided. The provided object is not interpreted in any ways by this constrain.- Parameters:
userObject- an arbitrary object provided by the user, ornull- Since:
- 3.8
-
-