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.

Parameters

name

The name to assign to the created object

Throws

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.

Parameters

name

The name to assign to the created object

configureClosure

The closure to configure the created object with

Throws

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.

Parameters

name

The name to assign to the created object

configureAction

The action to configure the created object with

Throws

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