gradle
8.3

# ListProperty

interface ListProperty<T> : Provider<T> , HasMultipleValues<T>

Represents a property whose type is a List of elements of type T.

You can create a ListProperty instance using factory method listProperty.

Note: This interface is not intended for implementation by build script or plugin authors.

#### Parameters

<T>

the type of elements.

## Functions

add
Link copied to clipboard
abstract fun add(element: T)
addAll
Link copied to clipboard
abstract fun addAll(elements: Array<T>)
assign
Link copied to clipboard
@Incubating
fun <T> HasMultipleValues<T>.assign(elements: Iterable<T?>?)

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

@Incubating
fun <T> 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: Iterable<out T>): ListProperty<T>
abstract fun convention(provider: Provider<out Iterable<out T>>): ListProperty<T>
disallowChanges
Link copied to clipboard
abstract fun disallowChanges()
disallowUnsafeRead
Link copied to clipboard
abstract fun disallowUnsafeRead()
empty
Link copied to clipboard
abstract fun empty(): ListProperty<T>
finalizeValue
Link copied to clipboard
abstract fun finalizeValue()
finalizeValueOnRead
Link copied to clipboard
abstract fun finalizeValueOnRead()
flatMap
Link copied to clipboard
abstract fun <S> flatMap(transformer: Transformer<out @Nullable Provider<out S>, out Any>): Provider<S>
forUseAtConfigurationTime
Link copied to clipboard
abstract fun forUseAtConfigurationTime(): Provider<T>
get
Link copied to clipboard
abstract fun get(): T
getOrElse
Link copied to clipboard
abstract fun getOrElse(defaultValue: T): T
getOrNull
Link copied to clipboard
abstract fun getOrNull(): T
isPresent
Link copied to clipboard
abstract fun isPresent(): Boolean
map
Link copied to clipboard
abstract fun <S> map(transformer: Transformer<out @Nullable S, out Any>): Provider<S>
orElse
Link copied to clipboard
abstract fun orElse(value: T): Provider<T>
set
Link copied to clipboard
abstract fun set(elements: Iterable<out T>)
value
Link copied to clipboard
abstract fun value(@Nullable elements: Iterable<out T>): ListProperty<T>
abstract fun value(provider: Provider<out Iterable<out T>>): ListProperty<T>
zip
Link copied to clipboard
abstract fun <U, R> zip(right: Provider<U>, combiner: BiFunction<out Any, out Any, out @Nullable R>): Provider<R>