# named

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

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:

- Must provide a zero-args constructor that is not private.
- Must not define or inherit any instance fields.
- Should not provide an implementation for getName and should define this method as abstract. Any implementation will be overridden.
- Must not define or inherit any other abstract methods.

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

Objects created using this method are not decorated or extensible.

#### Since

4.0

#### Throws

org.gradle.api.reflect.ObjectInstantiationException

On failure to create the new instance.