Overview | Package | Class | Deprecated | Index | Help
| Groovy Documentation
| FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD

## org.gradle.api.tasks
[Java] Interface TaskCollection

    org.gradle.api.DomainObjectCollection
      org.gradle.api.NamedDomainObjectSet
          java.lang.Iterable
              java.util.Collection
                  org.gradle.api.NamedDomainObjectCollection
                      org.gradle.api.tasks.TaskCollection

All Superinterfaces:
  DomainObjectCollection, NamedDomainObjectSet, NamedDomainObjectCollection

    public interface TaskCollection
    extends NamedDomainObjectSet

A `TaskCollection` contains a set of Task instances, and provides a number of query methods.

Parameters:
  `` - The type of tasks which this collection contains.

Method Summary
`void` | `allTasks(Action action)` Executes the given action against all tasks in this collection, and any tasks subsequently added to this collection.
`void` | `allTasks(groovy.lang.Closure closure)` Executes the given closure against all tasks in this collection, and any tasks subsequently added to this collection.
`T` | `getAt(java.lang.String name)` {@inheritDoc}
`T` | `getByName(java.lang.String name, groovy.lang.Closure configureClosure)` {@inheritDoc}
`T` | `getByName(java.lang.String name)` {@inheritDoc}
`TaskCollection` | `matching(Spec spec)` {@inheritDoc}
`TaskCollection` | `matching(groovy.lang.Closure closure)` {@inheritDoc}
`Action` | `whenTaskAdded(Action action)` Adds an `Action` to be executed when a task is added to this collection.
`void` | `whenTaskAdded(groovy.lang.Closure closure)` Adds a closure to be called when a task is added to this collection.
`TaskCollection` | `withType(java.lang.Class type)` {@inheritDoc}

Methods inherited from interface NamedDomainObjectSet
matching, matching, withType

Methods inherited from interface java.util.Set
java.util.Set#add(java.lang.Object), java.util.Set#equals(java.lang.Object), java.util.Set#hashCode(), java.util.Set#clear(), java.util.Set#size(), java.util.Set#isEmpty(), java.util.Set#contains(java.lang.Object), java.util.Set#addAll(java.util.Collection), java.util.Set#toArray(), java.util.Set#toArray([Ljava.lang.Object;), java.util.Set#iterator(), java.util.Set#remove(java.lang.Object), java.util.Set#removeAll(java.util.Collection), java.util.Set#containsAll(java.util.Collection), java.util.Set#retainAll(java.util.Collection)

Methods inherited from interface NamedDomainObjectCollection
add, addAll, addRule, addRule, findByName, getAsMap, getAt, getByName, getByName, getNamer, getRules, matching, matching, withType

Methods inherited from interface DomainObjectCollection
all, all, allObjects, allObjects, findAll, getAll, matching, matching, whenObjectAdded, whenObjectAdded, whenObjectRemoved, whenObjectRemoved, withType, withType, withType

Methods inherited from interface java.util.Collection
java.util.Collection#add(java.lang.Object), java.util.Collection#equals(java.lang.Object), java.util.Collection#hashCode(), java.util.Collection#clear(), java.util.Collection#size(), java.util.Collection#isEmpty(), java.util.Collection#contains(java.lang.Object), java.util.Collection#addAll(java.util.Collection), java.util.Collection#toArray(), java.util.Collection#toArray([Ljava.lang.Object;), java.util.Collection#iterator(), java.util.Collection#remove(java.lang.Object), java.util.Collection#removeAll(java.util.Collection), java.util.Collection#containsAll(java.util.Collection), java.util.Collection#retainAll(java.util.Collection)

Method Detail

### allTasks

    @Deprecated
    public void allTasks(Action action)

  Executes the given action against all tasks in this collection, and any tasks subsequently added to this collection.
  deprecated:
    Use all(org.gradle.api.Action) instead.
  Parameters:
    `action` - The action to be executed

### allTasks

    @Deprecated
    public void allTasks(groovy.lang.Closure closure)

  Executes the given closure against all tasks in this collection, and any tasks subsequently added to this collection.
  deprecated:
    Use all(groovy.lang.Closure) instead.
  Parameters:
    `closure` - The closure to be called

### getAt

    public T getAt(java.lang.String name)

  {@inheritDoc}

### getByName

    public T getByName(java.lang.String name, groovy.lang.Closure configureClosure)

  {@inheritDoc}

### getByName

    public T getByName(java.lang.String name)

  {@inheritDoc}

### matching

    public TaskCollection matching(Spec spec)

  {@inheritDoc}

### matching

    public TaskCollection matching(groovy.lang.Closure closure)

  {@inheritDoc}

### whenTaskAdded

    public Action whenTaskAdded(Action action)

  Adds an `Action` to be executed when a task is added to this collection.
  Parameters:
    `action` - The action to be executed
  Returns:
    the supplied action

### whenTaskAdded

    public void whenTaskAdded(groovy.lang.Closure closure)

  Adds a closure to be called when a task is added to this collection. The task is passed to the closure as the parameter.
  Parameters:
    `closure` - The closure to be called

### withType

    public TaskCollection withType(java.lang.Class type)

  {@inheritDoc}

Groovy Documentation