Schnittstelle TaskCollection<T extends Task>

Typparameter:
T - The type of tasks which this collection contains.
Alle Superschnittstellen:
Collection<T>, DomainObjectCollection<T>, DomainObjectSet<T>, Iterable<T>, NamedDomainObjectCollection<T>, NamedDomainObjectSet<T>, Set<T>
Alle bekannten Unterschnittstellen:
TaskContainer

public interface TaskCollection<T extends Task> extends NamedDomainObjectSet<T>
A TaskCollection contains a set of Task instances, and provides a number of query methods.
  • Methodendetails

    • named

      TaskCollection<T> named(Spec<String> nameFilter)
      Returns a collection containing the objects with names matching the provided filter. The returned collection is live, so that when matching objects are added to this collection, they are also visible in the filtered collection.

      This method is an intermediate operation. It does not change the realized/unrealized state of the elements in the collection.

      Angegeben von:
      named in Schnittstelle NamedDomainObjectCollection<T extends Task>
      Angegeben von:
      named in Schnittstelle NamedDomainObjectSet<T extends Task>
      Parameter:
      nameFilter - The specification to test names against.
      Gibt zurück:
      The collection of objects with names satisfying the filter. Returns an empty collection if there are no such objects in this collection.
    • matching

      TaskCollection<T> matching(Spec<? super T> spec)
      Returns a collection which contains the objects in this collection which meet the given specification. The returned collection is live, so that when matching objects are added to this collection, they are also visible in the filtered collection.

      This method is an intermediate eager operation. The application of the filter forces the realization of the collection elements.

      Angegeben von:
      matching in Schnittstelle DomainObjectCollection<T extends Task>
      Angegeben von:
      matching in Schnittstelle DomainObjectSet<T extends Task>
      Angegeben von:
      matching in Schnittstelle NamedDomainObjectCollection<T extends Task>
      Angegeben von:
      matching in Schnittstelle NamedDomainObjectSet<T extends Task>
      Parameter:
      spec - The specification to use.
      Gibt zurück:
      The collection of matching objects. Returns an empty collection if there are no such objects in this collection.
    • matching

      TaskCollection<T> matching(Closure closure)
      Returns a collection which contains the objects in this collection which meet the given closure specification. The returned collection is live, so that when matching objects are added to this collection, they are also visible in the filtered collection.

      This method is an intermediate eager operation. The application of the filter forces the realization of the collection elements.

      Angegeben von:
      matching in Schnittstelle DomainObjectCollection<T extends Task>
      Angegeben von:
      matching in Schnittstelle DomainObjectSet<T extends Task>
      Angegeben von:
      matching in Schnittstelle NamedDomainObjectCollection<T extends Task>
      Angegeben von:
      matching in Schnittstelle NamedDomainObjectSet<T extends Task>
      Parameter:
      closure - The specification to use. The closure gets a collection element as an argument.
      Gibt zurück:
      The collection of matching objects. Returns an empty collection if there are no such objects in this collection.
    • getByName

      T getByName(String name, Closure configureClosure) throws UnknownTaskException
      Locates an object by name, failing if there is no such object. The given configure closure is executed against the object before it is returned from this method. The object is passed to the closure as its delegate.

      This operation is eager and will cause the returned element to be realized.

      Angegeben von:
      getByName in Schnittstelle NamedDomainObjectCollection<T extends Task>
      Parameter:
      name - The object name
      configureClosure - The closure to use to configure the object.
      Gibt zurück:
      The object with the given name, after the configure closure has been applied to it. Never returns null.
      Löst aus:
      UnknownTaskException
    • getByName

      T getByName(String name) throws UnknownTaskException
      Locates an object by name, failing if there is no such object.

      This operation is eager and will cause the returned element to be realized.

      Angegeben von:
      getByName in Schnittstelle NamedDomainObjectCollection<T extends Task>
      Parameter:
      name - The object name
      Gibt zurück:
      The object with the given name. Never returns null.
      Löst aus:
      UnknownTaskException
    • withType

      <S extends T> TaskCollection<S> withType(Class<S> type)
      Returns a collection containing the objects in this collection of the given type. The returned collection is live, so that when matching objects are later added to this collection, they are also visible in the filtered collection.

      This method is an intermediate operation. It does not change the realized/unrealized state of the elements in the collection.

      Angegeben von:
      withType in Schnittstelle DomainObjectCollection<T extends Task>
      Angegeben von:
      withType in Schnittstelle DomainObjectSet<T extends Task>
      Angegeben von:
      withType in Schnittstelle NamedDomainObjectCollection<T extends Task>
      Angegeben von:
      withType in Schnittstelle NamedDomainObjectSet<T extends Task>
      Parameter:
      type - The type of objects to find.
      Gibt zurück:
      The matching objects. Returns an empty collection if there are no such objects in this collection.
    • whenTaskAdded

      Action<? super T> whenTaskAdded(Action<? super T> action)
      Adds an 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.

      Parameter:
      action - The action to be executed
      Gibt zurück:
      the supplied action
    • whenTaskAdded

      void whenTaskAdded(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.
      Parameter:
      closure - The closure to be called
      Siehe auch:
    • getAt

      T getAt(String name) throws UnknownTaskException
      Locates an object by name, failing if there is no such object. This method is identical to NamedDomainObjectCollection.getByName(String). You can call this method in your build script by using the groovy [] operator.

      This operation is eager and will cause the returned element to be realized.

      Angegeben von:
      getAt in Schnittstelle NamedDomainObjectCollection<T extends Task>
      Parameter:
      name - The object name
      Gibt zurück:
      The object with the given name. Never returns null.
      Löst aus:
      UnknownTaskException
    • named

      Locates a task by name, without triggering its creation or configuration, failing if there is no such object.
      Angegeben von:
      named in Schnittstelle NamedDomainObjectCollection<T extends Task>
      Parameter:
      name - The task name
      Gibt zurück:
      A Provider that will return the task when queried. The task may be created and configured at this point, if not already.
      Löst aus:
      UnknownTaskException - If a task with the given name is not defined.
      Seit:
      4.9
    • named

      TaskProvider<T> named(String name, Action<? super T> configurationAction) throws UnknownTaskException
      Locates a object by name, failing if there is no such object. The given configure action is executed against the object before it is returned from the provider.

      This method is lazy and will not cause the returned element to be realized.

      Angegeben von:
      named in Schnittstelle NamedDomainObjectCollection<T extends Task>
      Parameter:
      name - The object's name
      Gibt zurück:
      A Provider that will return the object when queried. The object may be created and configured at this point, if not already.
      Löst aus:
      UnknownTaskException
      Seit:
      5.0
    • named

      <S extends T> TaskProvider<S> named(String name, Class<S> type) throws UnknownTaskException
      Locates a object by name and type, failing if there is no such object.

      This method is lazy and will not cause the returned element to be realized.

      Angegeben von:
      named in Schnittstelle NamedDomainObjectCollection<T extends Task>
      Parameter:
      name - The object's name
      type - The object's type
      Gibt zurück:
      A Provider that will return the object when queried. The object may be created and configured at this point, if not already.
      Löst aus:
      UnknownTaskException
      Seit:
      5.0
    • named

      <S extends T> TaskProvider<S> named(String name, Class<S> type, Action<? super S> configurationAction) throws UnknownTaskException
      Locates a object by name and type, failing if there is no such object. The given configure action is executed against the object before it is returned from the provider.

      This method is lazy and will not cause the returned element to be realized.

      Angegeben von:
      named in Schnittstelle NamedDomainObjectCollection<T extends Task>
      Parameter:
      name - The object's name
      type - The object's type
      configurationAction - The action to use to configure the object.
      Gibt zurück:
      A Provider that will return the object when queried. The object may be created and configured at this point, if not already.
      Löst aus:
      UnknownTaskException
      Seit:
      5.0