Github user aledsage commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/816#discussion_r140608998
--- Diff:
utils/common/src/main/java/org/apache/brooklyn/util/repeat/Repeater.java ---
@@ -269,6 +274,21 @@ public Boolean call() throws Exception {
});
}
+ public <T> Repeater until(final Supplier<T> supplier, final
Predicate<T> exitCondition) {
+ Preconditions.checkNotNull(supplier, "supplier must not be null");
+ Preconditions.checkNotNull(exitCondition, "exitCondition must not
be null");
+ return until(new Callable<Boolean>() {
+ @Override
+ public Boolean call() throws Exception {
+ return exitCondition.apply(supplier.get());
+ }
+ @Override
+ public String toString() {
+ return supplier.get()+" "+exitCondition.toString();
--- End diff --
Should the toString really call `supplier.get()`? I'd have just used the
toString of the supplier itself.
---