API Documentation: TaskView

A view of the tasks that are created and configured as they are required.

Properties

Property Description

elements

The contents of this view as a Provider of <T> instances.

Methods

Method Description

withType(type)

Returns a task view containing the objects in this view of the given type. The returned view is live, so that when matching objects are later added to this view, they are also visible in the filtered task view.

configureEach(spec, action)

Registers an action to execute to configure each element in the view matching the given specification. The action is only executed for those elements that are required. Fails if any element has already been finalized.

configureEach(action)

Registers an action to execute to configure each element in the view. The action is only executed for those elements that are required. Fails if any element has already been finalized.

configureEach(type, closure)

Registers a closure to execute to configure each element in the view. The action is only executed for those elements that are required. Fails if any matching element has already been finalized.

This method is equivalent to view.withType(Foo).configureEach { …​ }.

configureEach(closure)

Registers a closure to execute to configure each element in the view. The action is only executed for those elements that are required. Fails if any element has already been finalized.

configureEach(spec, closure)

Registers a closure to execute to configure each element in the view matching the given specification. The action is only executed for those elements that are required. Fails if any element has already been finalized.

configureEach(type, action)

Registers an action to execute to configure each element in the view. The action is only executed for those elements that are required. Fails if any matching element has already been finalized.

This method is equivalent to view.withType(Foo).configureEach { …​ }.

get()

Returns the contents of this view as a Set of <T> instances.

map(mapper)

Returns a list containing the results of applying the given mapper function to each element in the view.

flatMap(mapper)

Returns a single list containing all elements yielded from results of mapper function being invoked on each element of this view.

filter(spec)

Returns a single list containing all elements matching the given specification.

Property Details

Provider<Set<T>> elements (read-only)

The contents of this view as a Provider of <T> instances.

The returned Provider is live, and tracks changes of the view.

Method Details

TaskView<S> withType(Class<S> type)

Returns a task view containing the objects in this view of the given type. The returned view is live, so that when matching objects are later added to this view, they are also visible in the filtered task view.

void configureEach(Spec<? super T> spec, Action<? super T> action)

Registers an action to execute to configure each element in the view matching the given specification. The action is only executed for those elements that are required. Fails if any element has already been finalized.

void configureEach(Action<? super T> action)

Registers an action to execute to configure each element in the view. The action is only executed for those elements that are required. Fails if any element has already been finalized.

void configureEach(Class<S> type, Closure<Void> closure)

Registers a closure to execute to configure each element in the view. The action is only executed for those elements that are required. Fails if any matching element has already been finalized.

This method is equivalent to view.withType(Foo).configureEach { …​ }.

void configureEach(Closure<Void> closure)

Registers a closure to execute to configure each element in the view. The action is only executed for those elements that are required. Fails if any element has already been finalized.

void configureEach(Spec<? super T> spec, Closure<Void> closure)

Registers a closure to execute to configure each element in the view matching the given specification. The action is only executed for those elements that are required. Fails if any element has already been finalized.

void configureEach(Class<S> type, Action<? super S> action)

Registers an action to execute to configure each element in the view. The action is only executed for those elements that are required. Fails if any matching element has already been finalized.

This method is equivalent to view.withType(Foo).configureEach { …​ }.

Set<T> get()

Returns the contents of this view as a Set of <T> instances.

Provider<List<S>> map(Transformer<? extends S, ? super T> mapper)

Returns a list containing the results of applying the given mapper function to each element in the view.

The returned Provider is live, and tracks changes of the view.

Provider<List<S>> flatMap(Transformer<? extends Iterable<S>, ? super T> mapper)

Returns a single list containing all elements yielded from results of mapper function being invoked on each element of this view.

The returned Provider is live, and tracks changes of the view.

Provider<List<T>> filter(Spec<? super T> spec)

Returns a single list containing all elements matching the given specification.

The returned Provider is live, and tracks changes of the view.