@Incubating interface PolymorphicDomainObjectContainer<T : Any> : NamedDomainObjectContainer<T>
A NamedDomainObjectContainer that allows to create domain objects with different types.
- the (base) type of domain objects in the container
abstract fun <U : T> containerWithType(type: Class<U>): NamedDomainObjectContainer<U>
Creates a regular container that wraps the polymorphic container presenting all elements of a specified type. |
|
abstract fun <U : T> create(name: String, type: Class<U>): U
Creates a domain object with the specified name and type, and adds it to the container. abstract fun <U : T> create(name: String, type: Class<U>, configuration: Action<in U>): U
Creates a domain object with the specified name and type, adds it to the container, and configures it with the specified action. |
|
abstract fun <U : T> maybeCreate(name: String, type: Class<U>): U
Looks for an item with the given name and type, creating and adding it to this container if it does not exist. |
abstract fun configure(configureClosure: Closure<Any>): NamedDomainObjectContainer<T>
Allows the container to be configured, creating missing objects as they are referenced. TODO: example usage |
|
abstract fun create(name: String): T
Creates a new item with the given name, adding it to this container. abstract fun create(name: String, configureClosure: Closure<Any>): T
Creates a new item with the given name, adding it to this container, then configuring it with the given closure. abstract fun create(name: String, configureAction: Action<in T>): T
Creates a new item with the given name, adding it to this container, then configuring it with the given action. |
|
abstract fun maybeCreate(name: String): T
Looks for an item with the given name, creating and adding it to this container if it does not exist. |
fun <U : Any> PolymorphicDomainObjectContainer<in U>.create(name: String, configuration: U.() -> Unit): U
Creates a domain object with the specified name and type, adds it to the container, and configures it with the specified action. fun <U : Any> PolymorphicDomainObjectContainer<in U>.create(name: String): U
Creates a domain object with the specified name and type, and adds it to the container. |
|
fun <T : Any, U : T> PolymorphicDomainObjectContainer<T>.creating(type: KClass<U>): PolymorphicDomainObjectContainerDelegateProvider<T, U>
Provides a property delegate that creates elements of the given type. fun <T : Any, U : T> PolymorphicDomainObjectContainer<T>.creating(type: KClass<U>, configuration: U.() -> Unit): PolymorphicDomainObjectContainerDelegateProvider<T, U>
Provides a property delegate that creates elements of the given type with the given configuration. fun <T : Any, U : T> PolymorphicDomainObjectContainer<T>.creating(type: Class<U>, configuration: U.() -> Unit): PolymorphicDomainObjectContainerDelegateProvider<T, U>
Provides a property delegate that creates elements of the given type expressed as a java.lang.Class with the given configuration. |
|
fun <U : Any> PolymorphicDomainObjectContainer<in U>.maybeCreate(name: String): U
Creates a domain object with the specified name and type if it does not exists, and adds it to the container. |
interface AuthenticationContainer : PolymorphicDomainObjectContainer<Authentication>
Container for configuring repository authentication schemes of type org.gradle.authentication.Authentication. |
|
interface ExtensiblePolymorphicDomainObjectContainer<T : Any> : PolymorphicDomainObjectContainer<T>, NamedDomainObjectFactoryRegistry
A org.gradle.api.PolymorphicDomainObjectContainer that can be extended at runtime to create elements of new types. |
|
class NamedDomainObjectContainerScope<T : Any> : NamedDomainObjectContainer<T>, PolymorphicDomainObjectContainer<T>
Receiver for NamedDomainObjectContainer configuration blocks. |
|
interface PlayDistributionContainer : PolymorphicDomainObjectContainer<Distribution>
Manages a set of org.gradle.api.distribution.Distribution objects. |
|
interface Repositories : PolymorphicDomainObjectContainer<ArtifactRepository>
The repositories that Gradle will search for prebuilt libraries. |
|
interface TaskContainer : TaskCollection<Task>, PolymorphicDomainObjectContainer<Task>
A You can obtain a |