T - type of the elements in this viewpublic interface DomainObjectView<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.
|
default void |
whenElementKnownEx(Action<? super KnownDomainObject<T>> action)
Executes given action when an element becomes known to the view.
|
default <S extends T> |
whenElementKnownEx(Class<S> type,
Action<? super KnownDomainObject<S>> action)
Executes given action when an element becomes known to the view of the specified type.
|
default <S extends T> |
whenElementKnownEx(Class<S> type,
groovy.lang.Closure<Void> closure)
Executes given closure when an element becomes known to the view of the specified type.
|
default void |
whenElementKnownEx(groovy.lang.Closure<Void> closure)
Executes given closure when an element becomes known to the view of the specified 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.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 satisfydefault void whenElementKnownEx(Action<? super KnownDomainObject<T>> action)
action - the action to execute for each known element of this viewdefault void whenElementKnownEx(@DelegatesTo(value=KnownDomainObject.class,strategy=1) groovy.lang.Closure<Void> closure)
closure - the closure to execute for each known element of this viewdefault <S extends T> void whenElementKnownEx(Class<S> type, Action<? super KnownDomainObject<S>> action)
S - the element type to matchtype - the element type to matchaction - the action to execute for each known element of this viewdefault <S extends T> void whenElementKnownEx(Class<S> type, @DelegatesTo(type="S",strategy=1) groovy.lang.Closure<Void> closure)
S - the element type to matchtype - the element type to matchclosure - the closure to execute for each known element of this view