interface NamedDomainObjectContainer<T : Any> : NamedDomainObjectSet<T>, Configurable
A named domain object container is a specialisation of NamedDomainObjectSet that adds the ability to create instances of the element type.
Implementations may use different strategies for creating new object instances.
Note that a container is an implementation of java.util.SortedSet, which means that the container is guaranteed to only contain elements with unique names within this container. Furthermore, items are ordered by their name.
- The type of domain objects in this container.
See Also
NamedDomainObjectSet
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. |
abstract fun findAll(spec: Closure<Any>): MutableSet<T>
{@inheritDoc} |
|
abstract fun matching(spec: Spec<in T>): NamedDomainObjectSet<T> abstract fun matching(spec: Closure<Any>): NamedDomainObjectSet<T>
{@inheritDoc} |
|
abstract fun <S : T> withType(type: Class<S>): NamedDomainObjectSet<S>
{@inheritDoc} |
val <T : Any> NamedDomainObjectContainer<T>.creating: NamedDomainObjectContainerDelegateProvider<T>
Provides a property delegate that creates elements of the default collection type. |
fun <T : Any> NamedDomainObjectContainer<T>.creating(configuration: T.() -> Unit): NamedDomainObjectContainerDelegateProvider<T>
Provides a property delegate that creates elements of the default collection type with the given configuration. |
|
fun <T : Any, U : T> NamedDomainObjectContainer<T>.getting(type: KClass<U>, configuration: U.() -> Unit): PolymorphicDomainObjectContainerGettingDelegateProvider<T, U>
Provides a property delegate that gets elements of the given type and applies the given configuration. fun <T : Any, U : T> NamedDomainObjectContainer<T>.getting(type: KClass<U>): PolymorphicDomainObjectContainerGettingDelegate<T, U>
Provides a property delegate that gets elements of the given type. |
|
operator fun <T : Any, C : NamedDomainObjectContainer<T>> C.invoke(configuration: NamedDomainObjectContainerScope<T>.() -> Unit): C
Allows the container to be configured, creating missing objects as they are referenced. |
interface ArtifactTypeContainer : NamedDomainObjectContainer<ArtifactTypeDefinition>
Defines a set of known artifact types and related meta-data. This allows you to fine tune how dependency resolution handles artifacts of a specific type. Each entry in this container defines a particular artifact type, such as a JAR or an AAR, and some information about that artifact type. |
|
interface BuildTypeContainer : NamedDomainObjectContainer<BuildType>
A container of BuildTypes. |
|
interface ConfigurationContainer : NamedDomainObjectContainer<Configuration>
A You can obtain a The configurations in a container are accessible as read-only properties of the container, using the name of the configuration as the property name. For example:
A dynamic method is added for each configuration which takes a configuration closure. This is equivalent to calling Examples An example showing how to refer to a given configuration by name in order to get hold of all dependencies (e.g. jars, but only) An example showing how to declare and configure configurations Examples on configuring the resolution strategy - see docs for ResolutionStrategy Please see the Managing Dependency Configurations User Guide chapter for more information.
|
|
interface DistributionContainer : NamedDomainObjectContainer<Distribution>
A |
|
interface FlavorContainer : NamedDomainObjectContainer<Flavor>
A container of Flavors. If no flavor is explicitly configured, will contain a single Flavor named 'default'. Any flavors explicitly configured will overwrite the default flavor. |
|
interface IvyConfigurationContainer : NamedDomainObjectContainer<IvyConfiguration>
The set of IvyConfigurations that will be included in the IvyPublication. Being a org.gradle.api.NamedDomainObjectContainer, a
|
|
class NamedDomainObjectContainerScope<T : Any> : NamedDomainObjectContainer<T>, PolymorphicDomainObjectContainer<T>
Receiver for NamedDomainObjectContainer configuration blocks. |
|
interface PolymorphicDomainObjectContainer<T : Any> : NamedDomainObjectContainer<T>
A NamedDomainObjectContainer that allows to create domain objects with different types. |
|
interface SourceSetContainer : NamedDomainObjectContainer<SourceSet>, NamedDomainObjectSet<SourceSet>
A |