|
Groovy Documentation | |||||||
FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | METHOD | DETAIL: FIELD | METHOD |
org.gradle.api.NamedDomainObjectSet org.gradle.api.PolymorphicDomainObjectContainer org.gradle.api.NamedDomainObjectContainer org.gradle.api.NamedDomainObjectCollection java.lang.Iterable org.gradle.api.DomainObjectCollection org.gradle.util.Configurable java.util.Collection
@Incubating public interface PolymorphicDomainObjectContainer extends NamedDomainObjectContainer
A NamedDomainObjectContainer that allows to create domain objects with different types.
- the (base) type of domain objects in the containerMethod Summary | |
---|---|
Object
|
create(String name, Class type)
Creates a domain object with the specified name and type, and adds it to the container. |
Object
|
create(String name, Class type, Action configuration)
Creates a domain object with the specified name and type, adds it to the container, and configures it with the specified action. |
Object
|
maybeCreate(String name, Class type)
Looks for an item with the given name and type, creating and adding it to this container if it does not exist. |
Methods inherited from interface NamedDomainObjectContainer | |
---|---|
configure, create, create, create, maybeCreate |
Methods inherited from interface NamedDomainObjectSet | |
---|---|
findAll, matching, matching, withType |
Method Detail |
---|
public Object create(String name, Class type)
name
- the name of the domain object to be createdtype
- the type of the domain object to be created
- the type of the domain object to be created
public Object create(String name, Class type, Action configuration)
name
- the name of the domain object to be createdtype
- the type of the domain object to be createdconfiguration
- an action for configuring the domain object
- the type of the domain object to be created
@Incubating public Object maybeCreate(String name, Class type)
name
- the name of the domain object to be createdtype
- the type of the domain object to be created
- the type of the domain object to be creatednull
.
Gradle API 1.12