/** returns a task for parallel execution returning a list of values for the given sensor for the given entity list, * optionally when the values satisfy a given readiness predicate (defaulting to groovy truth if not supplied) */ public static <T> Task<List<T>> listAttributesWhenReady(AttributeSensor<T> sensor, Iterable<Entity> entities) { return listAttributesWhenReady(sensor, entities, GroovyJavaMethods.truthPredicate()); }
public static <T> Task<List<T>> listAttributesWhenReady(AttributeSensor<T> sensor, Iterable<Entity> entities, Closure readiness) { Predicate<T> readinessPredicate = (readiness != null) ? GroovyJavaMethods.predicateFromClosure(readiness) : GroovyJavaMethods.truthPredicate(); return listAttributesWhenReady(sensor, entities, readiness); }