interface NamedDomainObjectList<T : Any> : NamedDomainObjectCollection<T>, MutableList<T>
A specialisation of org.gradle.api.NamedDomainObjectCollection that also implements java.util.List.
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>): MutableList<T>
{@inheritDoc} |
|
abstract fun matching(spec: Spec<in T>): NamedDomainObjectList<T> abstract fun matching(spec: Closure<Any>): NamedDomainObjectList<T>
{@inheritDoc} |
|
abstract fun <S : T> withType(type: Class<S>): NamedDomainObjectList<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 ArtifactRepositoryContainer : NamedDomainObjectList<ArtifactRepository>, Configurable
A You can obtain a The resolvers in a container are accessible as read-only properties of the container, using the name of the resolver as the property name. For example:
A dynamic method is added for each resolver which takes a configuration closure. This is equivalent to calling
|