Interface ListProperty<T>

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

@Incubating public interface ListProperty<T> extends Property<List<T>>
Represents a property whose type is a List of elements of type ListProperty.

Note: This interface is not intended for implementation by build script or plugin authors. An instance of this class can be created through the factory method ObjectFactory.listProperty(Class).

Since:
4.3
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(Provider<? extends T> provider)
    Adds an element to the property given by the provider without evaluating existing providers already present.
    void
    add(T element)
    Adds an element to the property without evaluating existing providers already present.
    void
    addAll(Provider<? extends Iterable<T>> provider)
    Adds a collection of elements to the property given by the provider without evaluating existing providers

    Methods inherited from interface org.gradle.api.provider.Property

    set, set

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

    get, getOrElse, getOrNull, isPresent, map
  • Method Details

    • add

      void add(T element)
      Adds an element to the property without evaluating existing providers already present.
      Parameters:
      element - The element
      Throws:
      NullPointerException - if the specified element is null
      Since:
      4.4
    • add

      void add(Provider<? extends T> provider)
      Adds an element to the property given by the provider without evaluating existing providers already present.

      The given provider will be queried when it's time to get the value of the property. This property will be unchanged if its value is not defined.

      Parameters:
      provider - Provider
      Since:
      4.4
    • addAll

      void addAll(Provider<? extends Iterable<T>> provider)
      Adds a collection of elements to the property given by the provider without evaluating existing providers

      The given provider will be queried when it's time to get the value of the property. This property will be unchanged if its value is not defined.

      Parameters:
      provider - Provider of elements
      Since:
      4.4