@Beta public class LinkTypeConstraint extends BooleanConstraint
Constructor and Description |
---|
LinkTypeConstraint(boolean inclusive,
Link.Type... types)
Creates a new constraint for requesting connectivity using or avoiding
the specified link types.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
boolean |
isInclusive()
Indicates if the constraint is inclusive or exclusive.
|
boolean |
isValid(Link link,
ResourceContext context)
Returns true if the specified link satisfies the constraint.
|
java.lang.String |
toString() |
java.util.Set<Link.Type> |
types()
Returns the set of link types.
|
cost, validate
public LinkTypeConstraint(boolean inclusive, Link.Type... types)
inclusive
- indicates whether the given link types are to be
permitted or avoidedtypes
- link typespublic boolean isValid(Link link, ResourceContext context)
BooleanConstraint
isValid
in class BooleanConstraint
link
- link to be validatedcontext
- resource context for checking available resourcespublic java.util.Set<Link.Type> types()
public boolean isInclusive()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public java.lang.String toString()
toString
in class java.lang.Object