# create

abstract fun create(name: String): T(source)

Creates a new item with the given name, adding it to this container.

This operation is eager, the element is realized before being returned.

#### Return

The created object. Never null.

#### Since

1.0

#### Parameters

name

The name to assign to the created object

#### Throws

org.gradle.api.InvalidUserDataException

if an object with the given name already exists in this container.

abstract fun create(name: String, configureClosure: Closure): T(source)

Creates a new item with the given name, adding it to this container, then configuring it with the given closure.

This operation is eager, the element is realized before being returned.

#### Return

The created object. Never null.

#### Since

1.0

#### Parameters

name

The name to assign to the created object

configureClosure

The closure to configure the created object with

#### Throws

org.gradle.api.InvalidUserDataException

if an object with the given name already exists in this container.

abstract fun create(name: String, configureAction: Action<in T>): T(source)

Creates a new item with the given name, adding it to this container, then configuring it with the given action.

This operation is eager, the element is realized before being returned.

#### Return

The created object. Never null.

#### Since

1.6

#### Parameters

name

The name to assign to the created object

configureAction

The action to configure the created object with

#### Throws

org.gradle.api.InvalidUserDataException

if an object with the given name already exists in this container.