T - type of the elements in this viewpublic interface View<T>
| Modifier and Type | Method and Description |
|---|---|
void |
configureEach(Action<? super T> action)
Registers an action to execute to configure each element in the view.
|
<S extends T> |
configureEach(Class<S> type,
Action<? super S> action)
Registers an action to execute to configure each element in the view.
|
default <S extends T> |
configureEach(Class<S> type,
groovy.lang.Closure<Void> closure)
Registers a closure to execute to configure each element in the view.
|
default void |
configureEach(groovy.lang.Closure<Void> closure)
Registers a closure to execute to configure each element in the 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.
|
default void |
configureEach(Spec<? super T> spec,
groovy.lang.Closure<Void> closure)
Registers a closure to execute to configure each element in the view matching the given specification.
|
Provider<List<T>> |
filter(Spec<? super T> spec)
Returns a single list containing all elements matching the given specification.
|
<S> 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.
|
Set<T> |
get()
Returns the contents of this view as a
Set of <T> instances. |
Provider<Set<T>> |
getElements()
Returns the contents of this view as a
Provider of <T> instances. |
<S> 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.
|
<S extends T> |
withType(Class<S> type)
Returns a view containing the objects in this view of the given type.
|
void configureEach(Action<? super T> action)
action - The action to execute on each element for configuration.default void configureEach(@DelegatesTo(type="T",strategy=1)
groovy.lang.Closure<Void> closure)
closure - The closure to execute on each element for configuration.<S extends T> void configureEach(Class<S> type, Action<? super S> action)
view.withType(Foo).configureEach { ... }.S - the base type of the element to configure.type - the type of binary to select.action - the action to execute on each element for configuration.default <S extends T> void configureEach(Class<S> type, @DelegatesTo(type="S",strategy=1) groovy.lang.Closure<Void> closure)
view.withType(Foo).configureEach { ... }.S - the base type of the element to configure.type - the type of binary to select.closure - the closure to execute on each element for configuration.void configureEach(Spec<? super T> spec, Action<? super T> action)
spec - a specification to satisfy. The spec is applied to each binary prior to configuration.action - the action to execute on each element for configuration.default void configureEach(Spec<? super T> spec, @DelegatesTo(type="S",strategy=1) groovy.lang.Closure<Void> closure)
spec - a specification to satisfy. The spec is applied to each binary prior to configuration.closure - the closure to execute on each element for configuration.<S extends T> View<S> withType(Class<S> type)
S - the base type of the element of the new view.type - the type of element to find.View, never null.Provider<Set<T>> getElements()
Provider of <T> instances.
The returned Provider is live, and tracks changes of the view.
Set<T> get()
Set of <T> instances.<S> Provider<List<S>> map(Transformer<? extends S,? super T> mapper)
The returned Provider is live, and tracks changes of the view.
S - the type of the mapped elementsmapper - a transform function to apply on each element of this view<S> Provider<List<S>> flatMap(Transformer<? extends Iterable<S>,? super T> mapper)
The returned Provider is live, and tracks changes of the view.
S - the type of the mapped elementsmapper - a transform function to apply on each element of this viewProvider<List<T>> filter(Spec<? super T> spec)
The returned Provider is live, and tracks changes of the view.
spec - a specification to satisfy