public class Requirement extends java.lang.Object implements IRequirement, IMemberProvider
IInstallableUnit.
Each requirement represents something an IInstallableUnit needs that
it expects to be provided by another IInstallableUnit. Requirements are
entirely generic, and are intended to be capable of representing anything that
an IInstallableUnit may need either at install time, or at runtime.
Instances of this class are handle objects and do not necessarily
reflect entities that exist in any particular profile or repository. These handle
objects can be created using MetadataFactory.
| Modifier and Type | Field and Description |
|---|---|
protected java.lang.String |
description |
protected IMatchExpression<IInstallableUnit> |
filter |
protected boolean |
greedy |
protected IMatchExpression<IInstallableUnit> |
matchExpression |
protected int |
max |
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 |
protected int |
min |
| Constructor and Description |
|---|
Requirement(IMatchExpression<IInstallableUnit> requirement,
IMatchExpression<IInstallableUnit> filter,
int min,
int max,
boolean greedy,
java.lang.String description) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(java.lang.Object obj) |
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.
|
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.
|
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
protected final IMatchExpression<IInstallableUnit> filter
protected final IMatchExpression<IInstallableUnit> matchExpression
protected final boolean greedy
protected final int min
protected final int max
protected final java.lang.String description
public Requirement(IMatchExpression<IInstallableUnit> requirement, IMatchExpression<IInstallableUnit> filter, int min, int max, boolean greedy, java.lang.String description)
public java.lang.String toString()
toString in class java.lang.Objectpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String getDescription()
IRequirementgetDescription in interface IRequirementpublic int getMin()
IRequirementgetMin in interface IRequirementpublic int getMax()
IRequirementgetMax in interface IRequirementpublic boolean isGreedy()
IRequirementisGreedy in interface IRequirementtrue if additional installable units should be installed
to satisfy this requirement, and false otherwisepublic IMatchExpression<IInstallableUnit> getFilter()
getFilter in interface IRequirementpublic IMatchExpression<IInstallableUnit> getMatches()
IRequirementIInstallableUnit that matches the requirement.getMatches 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 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 member