api / org.gradle.model / ModelSet

ModelSet

@Incubating interface ModelSet<T : Any> : MutableSet<T>, ModelElement

A set of managed model objects.

org.gradle.model.Managed types may declare managed set properties. Managed sets can only contain managed types.

Managed set objects cannot be mutated via the mutative methods of the java.util.Set interface (e.g. java.util.Set#add(Object), java.util.Set#clear()). To add elements to the set, the #create(Action) method can be used.

Parameters

- the type of model object

Functions

afterEach

abstract fun afterEach(configAction: Action<in T>): Unit

Apply the given action to each set element just before it is considered to be realised.

The configuration action is equivalent in terms of lifecycle to org.gradle.model.Finalize rule methods.

beforeEach

abstract fun beforeEach(configAction: Action<in T>): Unit

Apply the given action to each set element just after it is created.

The configuration action is equivalent in terms of lifecycle to org.gradle.model.Defaults rule methods.

create

abstract fun create(action: Action<in T>): Unit

Declares a new set element, configured by the given action.

Inherited Functions

getDisplayName

abstract fun getDisplayName(): String

Returns a human-consumable display name for this element.

getName

abstract fun getName(): String

Returns the name of this element. Each element has a name associated with it, that uniquely identifies the element amongst its siblings. Some element have their name generated or automatically assigned, and for these elements the name may not be human consumable.