# NamedDomainObjectSet

API Documentation: | `NamedDomainObjectSet`

Known Subtypes: |
`NamedDomainObjectContainer`
`TaskCollection`
`ReportContainer`

A specialization 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.

### Properties

No properties

### Methods

Method | Description
`getByName(name)` | Locates an object by name, failing if there is no such object.
`getByName(name, configureClosure)` | 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.
`getByName(name, configureAction)` | 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.
`named(name)` | Locates a object by name, failing if there is no such object.
`named(name, type)` | Locates a object by name and type, failing if there is no such object.
`named(name, type, configurationAction)` | 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.
`named(name, configurationAction)` | 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.
`named(nameFilter)` | Incubating 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.

### Script blocks

No script blocks

### Method details

#### `T` `getByName`(`String` name)

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.

#### `T` `getByName`(`String` name, `Closure` configureClosure)

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.

#### `T` `getByName`(`String` name, ``Action`<? super `T`>` configureAction)

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.

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

#### ``NamedDomainObjectProvider`<`T`>` `named`(`String` name)

Locates a object by name, failing if there is no such object.

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

#### ``NamedDomainObjectProvider`<`S`>` `named`(`String` name, ``Class`<`S`>` type)

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.

#### ``NamedDomainObjectProvider`<`S`>` `named`(`String` name, ``Class`<`S`>` type, ``Action`<? super `S`>` configurationAction)

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.

#### ``NamedDomainObjectProvider`<`T`>` `named`(`String` name, ``Action`<? super `T`>` configurationAction)

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.

#### ``NamedDomainObjectCollection`<`T`>` `named`(``Spec`<`String`>` nameFilter)

Note: This method is incubating and may change in a future version of Gradle.

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.