gradle
8.5

# named

abstract fun named(name: String): NamedDomainObjectProvider<T>(source)

Locates a object by name, without triggering its creation or configuration, failing if there is no such object.

#### Return

A Provider that will return the object when queried. The object may be created and configured at this point, if not already.

#### Parameters

name

The object's name

#### Throws

UnknownDomainObjectException

If a object with the given name is not defined.

abstract fun named(name: String, configurationAction: Action<out Any>): NamedDomainObjectProvider<T>(source)

Locates a object by name, without triggering its creation or configuration, failing if there is no such object. The given configure action is executed against the object before it is returned from the provider.

#### Return

A Provider that will return the object when queried. The object may be created and configured at this point, if not already.

#### Parameters

name

The object's name

#### Throws

UnknownDomainObjectException

If an object with the given name is not defined.

abstract fun <S : T?> named(name: String, type: Class<S>): NamedDomainObjectProvider<S>(source)

Locates a object by name and type, without triggering its creation or configuration, failing if there is no such object.

#### Return

A Provider that will return the object when queried. The object may be created and configured at this point, if not already.

#### Parameters

name

The object's name

type

The object's type

#### Throws

UnknownDomainObjectException

If an object with the given name is not defined.

abstract fun <S : T?> named(name: String, type: Class<S>, configurationAction: Action<out Any>): NamedDomainObjectProvider<S>(source)

Locates a object by name and type, without triggering its creation or configuration, failing if there is no such object. The given configure action is executed against the object before it is returned from the provider.

#### Return

A Provider that will return the object when queried. The object may be created and configured at this point, if not already.

#### Parameters

name

The object's name

type

The object's type

configurationAction

The action to use to configure the object.

#### Throws

UnknownDomainObjectException

If an object with the given name is not defined.