# HasMultipleValues

@SupportsKotlinAssignmentOverloading
interface HasMultipleValues<T> : HasConfigurableValue, SupportsConvention(source)

Represents a property whose value can be set using multiple elements of type T, such as a collection property.

Note: This interface is not intended for implementation by build script or plugin authors. You can use the factory methods on org.gradle.api.model.ObjectFactory to create various subtypes of this interface.

#### Since

4.5

#### Parameters

<T>

the type of elements.

#### Inheritors

ListProperty
SetProperty

## Functions

add
Link copied to clipboard
abstract fun add(element: T)
abstract fun add(provider: Provider<out T>)
Adds an element to the property value.
addAll
Link copied to clipboard
abstract fun addAll(elements: Array<T>)
abstract fun addAll(elements: Iterable<out T>)
abstract fun addAll(provider: Provider<out Iterable<out T>>)
Adds zero or more elements to the property value.
assign
Link copied to clipboard
fun <T : Any> HasMultipleValues<T>.assign(elements: Iterable<T>?)

Sets the value of the property to the elements of the given iterable, and replaces any existing value

fun <T : Any> HasMultipleValues<T>.assign(provider: Provider<out Iterable<T>>)

Sets the property to have the same value of the given provider, and replaces any existing value

convention
Link copied to clipboard
abstract fun convention(@Nullable elements: @Nullable Iterable<out T>): HasMultipleValues<T>
Specifies the value to use as the convention for this property.
abstract fun convention(provider: Provider<out Iterable<out T>>): HasMultipleValues<T>
Specifies the provider of the value to use as the convention for this property.
disallowChanges
Link copied to clipboard
abstract fun disallowChanges()
Disallows further direct changes to this object.
disallowUnsafeRead
Link copied to clipboard
abstract fun disallowUnsafeRead()
Disallows reading the value of this object when its value may not yet be available or may still change.
empty
Link copied to clipboard
abstract fun empty(): HasMultipleValues<T>
Sets the value of this property to an empty collection, and replaces any existing value.
finalizeValue
Link copied to clipboard
abstract fun finalizeValue()
Disallows further changes to the value of this property.
finalizeValueOnRead
Link copied to clipboard
abstract fun finalizeValueOnRead()
Requests that the final value of this object be calculated on the next read of the value, if not already known.
set
Link copied to clipboard
abstract fun set(@Nullable elements: @Nullable Iterable<out T>)
Sets the value of the property to the elements of the given iterable, and replaces any existing value.
abstract fun set(provider: Provider<out Iterable<out T>>)
Sets the property to have the same value of the given provider, and replaces any existing value.
unset
Link copied to clipboard
abstract fun unset(): SupportsConvention
Unsets this object's explicit value, allowing the convention to be selected when evaluating this object's value.
unsetConvention
Link copied to clipboard
abstract fun unsetConvention(): SupportsConvention
Unsets this object's convention value.
value
Link copied to clipboard
abstract fun value(@Nullable elements: @Nullable Iterable<out T>): HasMultipleValues<T>
Sets the value of the property to the elements of the given iterable, and replaces any existing value.
abstract fun value(provider: Provider<out Iterable<out T>>): HasMultipleValues<T>
Sets the property to have the same value of the given provider, and replaces any existing value.