Class MeteredConstraint
- java.lang.Object
-
- org.onosproject.net.intent.constraint.BooleanConstraint
-
- org.onosproject.net.intent.constraint.MeteredConstraint
-
- All Implemented Interfaces:
Constraint
@Beta public class MeteredConstraint extends BooleanConstraint
Constraint that evaluates links based on the metered flag.
-
-
Constructor Summary
Constructors Constructor Description MeteredConstraint(boolean metered)
Creates a new constraint for requesting connectivity using or avoiding the metered links.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
int
hashCode()
boolean
isUseMetered()
Indicates if the constraint is metered or not.boolean
isValid(Link link, ResourceContext context)
Returns true if the specified link satisfies the constraint.String
toString()
-
Methods inherited from class org.onosproject.net.intent.constraint.BooleanConstraint
cost, validate
-
-
-
-
Method Detail
-
isValid
public boolean isValid(Link link, ResourceContext context)
Description copied from class:BooleanConstraint
Returns true if the specified link satisfies the constraint.- Specified by:
isValid
in classBooleanConstraint
- Parameters:
link
- link to be validatedcontext
- resource context for checking available resources- Returns:
- true if link is viable
-
isUseMetered
public boolean isUseMetered()
Indicates if the constraint is metered or not.- Returns:
- true if metered
-
-