Class LinkTypeConstraint
- java.lang.Object
-
- org.onosproject.net.intent.constraint.BooleanConstraint
-
- org.onosproject.net.intent.constraint.LinkTypeConstraint
-
- All Implemented Interfaces:
Constraint
@Beta public class LinkTypeConstraint extends BooleanConstraint
Constraint that evaluates links based on their type.
-
-
Constructor Summary
Constructors Constructor Description LinkTypeConstraint(boolean inclusive, Link.Type... types)Creates a new constraint for requesting connectivity using or avoiding the specified link types.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)inthashCode()booleanisInclusive()Indicates if the constraint is inclusive or exclusive.booleanisValid(Link link, ResourceContext context)Returns true if the specified link satisfies the constraint.java.lang.StringtoString()java.util.Set<Link.Type>types()Returns the set of link types.-
Methods inherited from class org.onosproject.net.intent.constraint.BooleanConstraint
cost, validate
-
-
-
-
Constructor Detail
-
LinkTypeConstraint
public LinkTypeConstraint(boolean inclusive, Link.Type... types)Creates a new constraint for requesting connectivity using or avoiding the specified link types.- Parameters:
inclusive- indicates whether the given link types are to be permitted or avoidedtypes- link types
-
-
Method Detail
-
isValid
public boolean isValid(Link link, ResourceContext context)
Description copied from class:BooleanConstraintReturns true if the specified link satisfies the constraint.- Specified by:
isValidin classBooleanConstraint- Parameters:
link- link to be validatedcontext- resource context for checking available resources- Returns:
- true if link is viable
-
types
public java.util.Set<Link.Type> types()
Returns the set of link types.- Returns:
- set of link types
-
isInclusive
public boolean isInclusive()
Indicates if the constraint is inclusive or exclusive.- Returns:
- true if inclusive
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-