Class ObstacleConstraint
- java.lang.Object
-
- org.onosproject.net.intent.constraint.BooleanConstraint
-
- org.onosproject.net.intent.constraint.ObstacleConstraint
-
- All Implemented Interfaces:
Constraint
@Beta public class ObstacleConstraint extends BooleanConstraint
Constraint that evaluates elements not passed through.
-
-
Constructor Summary
Constructors Constructor Description ObstacleConstraint(DeviceId... obstacles)
Creates a new constraint that the specified device are not passed through.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
int
hashCode()
boolean
isValid(Link link, ResourceContext context)
Returns true if the specified link satisfies the constraint.Set<DeviceId>
obstacles()
Returns the obstacle device ids.String
toString()
-
Methods inherited from class org.onosproject.net.intent.constraint.BooleanConstraint
cost, validate
-
-
-
-
Constructor Detail
-
ObstacleConstraint
public ObstacleConstraint(DeviceId... obstacles)
Creates a new constraint that the specified device are not passed through.- Parameters:
obstacles
- devices not to be passed
-
-
Method Detail
-
obstacles
public Set<DeviceId> obstacles()
Returns the obstacle device ids.- Returns:
- Set of obstacle device ids
-
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
-
-