interface NamedDomainObjectSet<T : Any> : NamedDomainObjectCollection<T>, MutableSet<T>
A specialisation of NamedDomainObjectCollection that also implements Set and orders objects by their inherent name.
All object equality is determined in terms of object names. That is, calling remove()
with an object that is NOT equal to an existing object in terms of equals
, but IS in terms of name equality will result in the existing collection item with the equal name being removed.
- The type of element in the set
abstract fun findAll(spec: Closure<Any>): MutableSet<T>
{@inheritDoc} |
|
abstract fun matching(spec: Spec<in T>): NamedDomainObjectSet<T> abstract fun matching(spec: Closure<Any>): NamedDomainObjectSet<T>
{@inheritDoc} |
|
abstract fun <S : T> withType(type: Class<S>): NamedDomainObjectSet<S>
{@inheritDoc} |
abstract fun add(element: T): Boolean
Adds an object to the collection, if there is no existing object in the collection with the same name. |
|
abstract fun addAll(elements: Collection<T>): Boolean
Adds any of the given objects to the collection that do not have the same name as any existing element. |
|
abstract fun addRule(rule: Rule): Rule
Adds a rule to this collection. The given rule is invoked when an unknown object is requested by name. abstract fun addRule(description: String, ruleAction: Closure<Any>): Rule
Adds a rule to this collection. The given closure is executed when an unknown object is requested by name. The requested name is passed to the closure as a parameter. abstract fun addRule(description: String, ruleAction: Action<String>): Rule
Adds a rule to this collection. The given action is executed when an unknown object is requested by name. The requested name is passed to the action. |
|
abstract fun findByName(name: String): T
Locates an object by name, returning null if there is no such object. |
|
abstract fun getAsMap(): SortedMap<String, T>
Returns the objects in this collection, as a map from object name to object instance. The map is ordered by the natural ordering of the object names (i.e. keys). |
|
abstract fun getAt(name: String): T
Locates an object by name, failing if there is no such task. This method is identical to |
|
abstract fun getByName(name: String): T
Locates an object by name, failing if there is no such object. abstract fun getByName(name: String, configureClosure: Closure<Any>): T
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. abstract fun getByName(name: String, configureAction: Action<in T>): T
Locates an object by name, failing if there is no such object. The given configure action is executed against the object before it is returned from this method. |
|
abstract fun getNamer(): Namer<T>
An object that represents the naming strategy used to name objects of this collection. |
|
abstract fun getNames(): SortedSet<String>
Returns the names of the objects in this collection as a Set of Strings. The set of names is in natural ordering. |
|
abstract fun getRules(): MutableList<Rule>
Returns the rules used by this collection. |
interface NamedDomainObjectContainer<T : Any> : NamedDomainObjectSet<T>, Configurable
A named domain object container is a specialisation of NamedDomainObjectSet that adds the ability to create instances of the element type. Implementations may use different strategies for creating new object instances. Note that a container is an implementation of java.util.SortedSet, which means that the container is guaranteed to only contain elements with unique names within this container. Furthermore, items are ordered by their name. |
|
interface PrebuiltLibraries : ArtifactRepository, NamedDomainObjectSet<PrebuiltLibrary>
A container of PrebuiltLibrary instances. |
|
interface ReportContainer<T : Report> : NamedDomainObjectSet<T>, Configurable
A container of Report objects, that represent potential reports. Things that produce reports (typically tasks) expose a report container that contains Report objects for each possible report that they can produce. Each report object can be configured individually, including whether or not it should be produced by way of its |
|
interface SoftwareComponentContainer : NamedDomainObjectSet<SoftwareComponent>
A Container that contains all of the Software Components produced by a Project. |
|
interface SourceSetContainer : NamedDomainObjectContainer<SourceSet>, NamedDomainObjectSet<SourceSet>
A |
|
interface TaskCollection<T : Task> : NamedDomainObjectSet<T>
A |