@Beta public class LatencyConstraint extends java.lang.Object implements Constraint
Constructor and Description |
---|
LatencyConstraint(java.time.Duration latency)
Creates a new constraint to keep under specified latency through a path.
|
Modifier and Type | Method and Description |
---|---|
double |
cost(Link link,
ResourceContext context)
Evaluates the specified link and provides the cost for its traversal.
|
boolean |
equals(java.lang.Object obj) |
int |
hashCode() |
java.time.Duration |
latency() |
java.lang.String |
toString() |
boolean |
validate(Path path,
ResourceContext context)
Validates that the specified path satisfies the constraint.
|
public LatencyConstraint(java.time.Duration latency)
latency
- latency to be keptpublic java.time.Duration latency()
public double cost(Link link, ResourceContext context)
Constraint
cost
in interface Constraint
link
- link to be evaluatedcontext
- resource context for validating availability of resourcespublic boolean validate(Path path, ResourceContext context)
Constraint
validate
in interface Constraint
path
- path to be validatedcontext
- resource context for validating availability of resourcespublic 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