api / org.gradle.api.model / ObjectFactory / named

named

abstract fun <T : Named> named(type: Class<T>, name: String): T

Creates a simple immutable Named object of the given type and name.

The given type can be an interface that extends Named or an abstract class that 'implements' Named. An abstract class, if provided:

An interface, if provided, must not define or inherit any other methods.

Objects created using this method are not decorated or extensible.

Exceptions

ObjectInstantiationException - On failure to create the new instance.

Since
4.0