public class RequiredCapability extends java.lang.Object implements IRequiredCapability, IMemberProvider
IInstallableUnit.
Each capability represents something an IInstallableUnit needs that
it expects to be provided by another IInstallableUnit. Capabilities are
entirely generic, and are intended to be capable of representing anything that
an IInstallableUnit may need either at install time, or at runtime.
Capabilities are segmented into namespaces. Anyone can introduce new capability namespaces. Some well-known namespaces are introduced directly by the provisioning framework.
IInstallableUnit.NAMESPACE_IU_ID| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
MEMBER_FILTER |
static java.lang.String |
MEMBER_GREEDY |
static java.lang.String |
MEMBER_MATCH |
static java.lang.String |
MEMBER_MAX |
static java.lang.String |
MEMBER_MIN |
| Constructor and Description |
|---|
RequiredCapability(IMatchExpression<IInstallableUnit> requirement,
IMatchExpression<IInstallableUnit> filter,
int min,
int max,
boolean greedy,
java.lang.String description) |
RequiredCapability(java.lang.String namespace,
java.lang.String name,
VersionRange range,
IMatchExpression<IInstallableUnit> filter,
int min,
int max,
boolean greedy,
java.lang.String description) |
RequiredCapability(java.lang.String namespace,
java.lang.String name,
VersionRange range,
java.lang.String filter,
boolean optional,
boolean multiple)
TODO replace booleans with int options flag.
|
RequiredCapability(java.lang.String namespace,
java.lang.String name,
VersionRange range,
java.lang.String filter,
boolean optional,
boolean multiple,
boolean greedy) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
static java.lang.String |
extractName(IMatchExpression<IInstallableUnit> matchExpression) |
static java.lang.String |
extractNamespace(IMatchExpression<IInstallableUnit> matchExpression) |
static VersionRange |
extractRange(IMatchExpression<IInstallableUnit> matchExpression) |
java.lang.String |
getDescription()
Returns a textual description of this requirement.
|
IMatchExpression<IInstallableUnit> |
getFilter() |
IMatchExpression<IInstallableUnit> |
getMatches()
Returns a boolean match expression that will return true for any
IInstallableUnit that matches the requirement. |
int |
getMax()
Returns the maximum cardinality of the requirement.
|
java.lang.Object |
getMember(java.lang.String memberName)
Returns the value for the specified member.
|
int |
getMin()
Returns the minimum cardinality of the requirement.
|
java.lang.String |
getName() |
java.lang.String |
getNamespace() |
VersionRange |
getRange()
Returns the range of versions that satisfy this required capability.
|
int |
hashCode() |
boolean |
isGreedy()
Returns whether this requirement should cause extra installable units
to be installed in order to satisfy it.
|
boolean |
isMatch(IInstallableUnit candidate)
Returns whether the provided capabilities of the given installable unit satisfy
this requirement.
|
static boolean |
isSimpleRequirement(IMatchExpression<IInstallableUnit> matchExpression) |
static boolean |
isVersionStrict(IMatchExpression<IInstallableUnit> matchExpression) |
java.lang.String |
toString() |
public static final java.lang.String MEMBER_FILTER
public static final java.lang.String MEMBER_MIN
public static final java.lang.String MEMBER_MAX
public static final java.lang.String MEMBER_GREEDY
public static final java.lang.String MEMBER_MATCH
public RequiredCapability(java.lang.String namespace,
java.lang.String name,
VersionRange range,
java.lang.String filter,
boolean optional,
boolean multiple)
public RequiredCapability(IMatchExpression<IInstallableUnit> requirement, IMatchExpression<IInstallableUnit> filter, int min, int max, boolean greedy, java.lang.String description)
public RequiredCapability(java.lang.String namespace,
java.lang.String name,
VersionRange range,
java.lang.String filter,
boolean optional,
boolean multiple,
boolean greedy)
public RequiredCapability(java.lang.String namespace,
java.lang.String name,
VersionRange range,
IMatchExpression<IInstallableUnit> filter,
int min,
int max,
boolean greedy,
java.lang.String description)
public boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String getName()
getName in interface IRequiredCapabilitypublic java.lang.String getNamespace()
getNamespace in interface IRequiredCapabilitypublic VersionRange getRange()
VersionRange.emptyRange if any version
will satisfy the capability.getRange in interface IRequiredCapabilitypublic int hashCode()
hashCode in class java.lang.Objectpublic boolean isGreedy()
IRequirementisGreedy in interface IRequirementtrue if additional installable units should be installed
to satisfy this requirement, and false otherwisepublic java.lang.String toString()
toString in class java.lang.Objectpublic int getMin()
IRequirementgetMin in interface IRequirementpublic int getMax()
IRequirementgetMax in interface IRequirementpublic IMatchExpression<IInstallableUnit> getMatches()
IRequirementIInstallableUnit that matches the requirement.getMatches in interface IRequirementpublic IMatchExpression<IInstallableUnit> getFilter()
getFilter in interface IRequirementpublic boolean isMatch(IInstallableUnit candidate)
IRequirementisMatch in interface IRequirementcandidate - the installable unit to check for matching capabilitiestrue if the given installable unit satisfies this
requirement, and false otherwise.public static boolean isVersionStrict(IMatchExpression<IInstallableUnit> matchExpression)
public static java.lang.String extractName(IMatchExpression<IInstallableUnit> matchExpression)
public static java.lang.String extractNamespace(IMatchExpression<IInstallableUnit> matchExpression)
public static VersionRange extractRange(IMatchExpression<IInstallableUnit> matchExpression)
public static boolean isSimpleRequirement(IMatchExpression<IInstallableUnit> matchExpression)
public java.lang.Object getMember(java.lang.String memberName)
IMemberProvidermemberName is a string that has been
internalized using String.intern().getMember in interface IMemberProvidermemberName - The name of the memberpublic java.lang.String getDescription()
IRequirementgetDescription in interface IRequirement