Github user alasdairhodge commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/583#discussion_r104868086
--- Diff:
utils/common/src/main/java/org/apache/brooklyn/util/guava/Functionals.java ---
@@ -148,4 +148,16 @@ public String toString() {
return new FunctionAsPredicate();
}
+ /**
+ * Simple adapter from {@link Predicate} to {@link Callable} by
currying the passed <tt>subject</tt> parameter.
+ */
+ public static <T> Callable<Boolean> isSatisfied(final T subject, final
Predicate<T> predicate) {
+ return new Callable<Boolean>() {
+ @Override
+ public Boolean call() {
+ return predicate.apply(subject);
+ }
+ };
+ }
--- End diff --
Wasn't really sure where to stick this utility method; there are other
`Callable` related methods here, so it seemed as good a place as any.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---