@Beta public final class BandwidthConstraint extends BooleanConstraint
Constructor and Description |
---|
BandwidthConstraint(Bandwidth bandwidth)
Creates a new bandwidth constraint.
|
Modifier and Type | Method and Description |
---|---|
Bandwidth |
bandwidth()
Returns the bandwidth required by this constraint.
|
boolean |
equals(Object obj) |
int |
hashCode() |
boolean |
isValid(Link link,
ResourceContext context)
Returns true if the specified link satisfies the constraint.
|
static BandwidthConstraint |
of(double v,
DataRateUnit unit)
Creates a new bandwidth constraint.
|
String |
toString() |
cost, validate
public BandwidthConstraint(Bandwidth bandwidth)
bandwidth
- required bandwidthpublic static BandwidthConstraint of(double v, DataRateUnit unit)
v
- required amount of bandwidthunit
- DataRateUnit
of v
BandwidthConstraint
instance with given bandwidth requirementpublic boolean isValid(Link link, ResourceContext context)
BooleanConstraint
isValid
in class BooleanConstraint
link
- link to be validatedcontext
- resource context for checking available resourcespublic Bandwidth bandwidth()