@Test public void testCost() { sut = new LatencyConstraint(Duration.of(10, ChronoUnit.MICROS)); assertThat(sut.cost(link1, resourceContext), is(closeTo(Double.parseDouble(LATENCY1), 1.0e-6))); assertThat(sut.cost(link2, resourceContext), is(closeTo(Double.parseDouble(LATENCY2), 1.0e-6))); }
@Override public double cost(Link link, ResourceContext context) { return cost(link); }
LatencyConstraint implements Constraint { @Override public double cost(Link link, ResourceContext context) { return cost(link); } }
LatencyConstraint implements Constraint { @Override public double cost(Link link, ResourceContext context) { return cost(link); } LatencyConstraint(Duration latency); private  LatencyConstraint(); }
LatencyConstraint implements Constraint { @Override public double cost(Link link, ResourceContext context) { return cost(link); } LatencyConstraint(Duration latency); private  LatencyConstraint(); Duration latency(); @Override double cost(Link link, ResourceContext context); @Override boolean validate(Path path, ResourceContext context); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString(); }
LatencyConstraint implements Constraint { @Override public double cost(Link link, ResourceContext context) { return cost(link); } LatencyConstraint(Duration latency); private  LatencyConstraint(); Duration latency(); @Override double cost(Link link, ResourceContext context); @Override boolean validate(Path path, ResourceContext context); @Override int hashCode(); @Override boolean equals(Object obj); @Override String toString();  }