# maybeCreate

inline fun <U : T, T : Any> ERROR CLASS: Symbol not found for org.gradle.api.PolymorphicDomainObjectContainer<T>.maybeCreate(name: String, type: KClass<U>): U(source)
inline fun <U : T, T : Any> ERROR CLASS: Symbol not found for org.gradle.api.PolymorphicDomainObjectContainer<T>.maybeCreate(name: String, type: KClass<U>): U(source)

Kotlin extension function taking kotlin.reflect.KClass for org.gradle.api.PolymorphicDomainObjectContainer.maybeCreate.

#### See also

org.gradle.api.PolymorphicDomainObjectContainer.maybeCreate

inline fun <U : Any> ERROR CLASS: Symbol not found for PolymorphicDomainObjectContainer<in U>.maybeCreate(name: String): ERROR CLASS: Ambiguity: maybeCreate, [org/gradle/kotlin/dsl/maybeCreate, org/gradle/kotlin/dsl/maybeCreate, org/gradle/kotlin/dsl/maybeCreate](source)

Creates a domain object with the specified name and type if it does not exists, and adds it to the container.

#### Return

the created domain object

#### Parameters

name

the name of the domain object to be created

the type of the domain object to be created

#### Throws

InvalidUserDataException

if a domain object with the specified name already exists or the container does not support creating a domain object with the specified type

ClassCastException

if a domain object with the specified name exists with a different type