T - The type of tasks which this collection contains.java.util.Collection<T>, DomainObjectCollection<T>, java.lang.Iterable<T>, NamedDomainObjectCollection<T>, NamedDomainObjectSet<T>, java.util.Set<T>TaskContainerpublic interface TaskCollection<T extends Task> extends NamedDomainObjectSet<T>
TaskCollection contains a set of Task instances, and provides a number of query methods.| Modifier and Type | Method | Description | 
|---|---|---|
| T | getAt(java.lang.String name) | Locates an object by name, failing if there is no such task. | 
| T | getByName(java.lang.String name) | Locates an object by name, failing if there is no such object. | 
| T | getByName(java.lang.String name,
         groovy.lang.Closure configureClosure) | Locates an object by name, failing if there is no such object. | 
| TaskCollection<T> | matching(groovy.lang.Closure closure) | Returns a collection which contains the objects in this collection which meet the given closure specification. | 
| TaskCollection<T> | matching(Spec<? super T> spec) | Returns a collection which contains the objects in this collection which meet the given specification. | 
| TaskProvider<T> | named(java.lang.String name) | Locates a task by name, without triggering its creation or configuration, failing if there is no such object. | 
| <S extends T> | named(java.lang.String name,
     java.lang.Class<S> type) | Locates a object by name and type, without triggering its creation or configuration, failing if there is no such object. | 
| <S extends T> | named(java.lang.String name,
     java.lang.Class<S> type,
     Action<? super S> configurationAction) | Locates a object by name and type, without triggering its creation or configuration, failing if there is no such object. | 
| TaskProvider<T> | named(java.lang.String name,
     Action<? super T> configurationAction) | Locates a object by name, without triggering its creation or configuration, failing if there is no such object. | 
| void | whenTaskAdded(groovy.lang.Closure closure) | Adds a closure to be called when a task is added to this collection. | 
| Action<? super T> | whenTaskAdded(Action<? super T> action) | Adds an  Actionto be executed when a task is added to this collection. | 
| <S extends T> | withType(java.lang.Class<S> type) | Returns a collection containing the objects in this collection of the given type. | 
clear, contains, containsAll, equals, hashCode, isEmpty, iterator, parallelStream, remove, removeAll, removeIf, retainAll, size, spliterator, stream, toArray, toArrayaddAllLater, addLater, all, all, configureEach, whenObjectAdded, whenObjectAdded, whenObjectRemoved, whenObjectRemoved, withType, withTypeadd, addAll, addRule, addRule, addRule, findByName, getAsMap, getByName, getCollectionSchema, getNamer, getNames, getRulesfindAllTaskCollection<T> matching(Spec<? super T> spec)
matching in interface DomainObjectCollection<T extends Task>matching in interface NamedDomainObjectCollection<T extends Task>matching in interface NamedDomainObjectSet<T extends Task>spec - The specification to use.TaskCollection<T> matching(groovy.lang.Closure closure)
matching in interface DomainObjectCollection<T extends Task>matching in interface NamedDomainObjectCollection<T extends Task>matching in interface NamedDomainObjectSet<T extends Task>closure - The specification to use. The closure gets a collection element as an argument.T getByName(java.lang.String name, groovy.lang.Closure configureClosure) throws UnknownTaskException
getByName in interface NamedDomainObjectCollection<T extends Task>name - The object nameconfigureClosure - The closure to use to configure the object.UnknownTaskExceptionT getByName(java.lang.String name) throws UnknownTaskException
getByName in interface NamedDomainObjectCollection<T extends Task>name - The object nameUnknownTaskException<S extends T> TaskCollection<S> withType(java.lang.Class<S> type)
withType in interface DomainObjectCollection<T extends Task>withType in interface NamedDomainObjectCollection<T extends Task>withType in interface NamedDomainObjectSet<T extends Task>type - The type of objects to find.Action<? super T> whenTaskAdded(Action<? super T> action)
Action to be executed when a task is added to this collection.
 
 Like DomainObjectCollection.all(Action), this method will cause all tasks in this container to be realized.
 
action - The action to be executedvoid whenTaskAdded(groovy.lang.Closure closure)
closure - The closure to be calledwhenTaskAdded(Action)T getAt(java.lang.String name) throws UnknownTaskException
NamedDomainObjectCollection.getByName(String). You can call this method in your build script by using the groovy [] operator.getAt in interface NamedDomainObjectCollection<T extends Task>name - The object nameUnknownTaskException@Incubating TaskProvider<T> named(java.lang.String name) throws UnknownTaskException
named in interface NamedDomainObjectCollection<T extends Task>name - The task nameProvider that will return the task when queried. The task may be created and configured at this point, if not already.UnknownTaskException - If a task with the given name is not defined.@Incubating TaskProvider<T> named(java.lang.String name, Action<? super T> configurationAction) throws UnknownTaskException
named in interface NamedDomainObjectCollection<T extends Task>name - The object's nameProvider that will return the object when queried. The object may be created and configured at this point, if not already.UnknownTaskException@Incubating <S extends T> TaskProvider<S> named(java.lang.String name, java.lang.Class<S> type) throws UnknownTaskException
named in interface NamedDomainObjectCollection<T extends Task>name - The object's nametype - The object's typeProvider that will return the object when queried. The object may be created and configured at this point, if not already.UnknownTaskException@Incubating <S extends T> TaskProvider<S> named(java.lang.String name, java.lang.Class<S> type, Action<? super S> configurationAction) throws UnknownTaskException
named in interface NamedDomainObjectCollection<T extends Task>name - The object's nametype - The object's typeconfigurationAction - The action to use to configure the object.Provider that will return the object when queried. The object may be created and configured at this point, if not already.UnknownTaskException