Package org.gradle.api.provider

## Interface ListProperty<T>

- Type Parameters:
    `T` - the type of elements.
  All Superinterfaces:
    `HasMultipleValues<T>`, `Provider<List<T>>`

      @Incubating
      public interface ListProperty<T>
      extends Provider<List<T>>, HasMultipleValues<T>

  Represents a property whose type is a `List` of elements of type `ListProperty`.

  You can create a `ListProperty` instance using factory method `ObjectFactory.listProperty(Class)`.

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

  Since:
    4.3

- - ### Method Summary

    All Methods Instance Methods Abstract Methods
    Modifier and Type | Method | Description
    --- | --- | ---
    `ListProperty<T>` | `convention​(Iterable<? extends T> elements)` | Specifies the value to use as the convention for this property.
    `ListProperty<T>` | `convention​(Provider<? extends Iterable<? extends T>> provider)` | Specifies the provider of the value to use as the convention for this property.
    `ListProperty<T>` | `empty()` | Sets the value of this property to an empty collection, and replaces any existing value.

    - ### Methods inherited from interface org.gradle.api.provider.HasMultipleValues

      `add, add, addAll, addAll, addAll, finalizeValue, set, set`

    - ### Methods inherited from interface org.gradle.api.provider.Provider

      `flatMap, get, getOrElse, getOrNull, isPresent, map`

- - ### Method Detail

    - #### empty

          ListProperty<T> empty()

      Sets the value of this property to an empty collection, and replaces any existing value.
      Specified by:
        `empty` in interface `HasMultipleValues<T>`
      Returns:
        this property.

    - #### convention

          ListProperty<T> convention​(Iterable<? extends T> elements)

      Specifies the value to use as the convention for this property. The convention is used when no value has been set for this property.
      Specified by:
        `convention` in interface `HasMultipleValues<T>`
      Parameters:
        `elements` - The elements
      Returns:
        this

    - #### convention

          ListProperty<T> convention​(Provider<? extends Iterable<? extends T>> provider)

      Specifies the provider of the value to use as the convention for this property. The convention is used when no value has been set for this property.
      Specified by:
        `convention` in interface `HasMultipleValues<T>`
      Parameters:
        `provider` - The provider of the elements
      Returns:
        this