Interface HasMultipleValues<T>

Type Parameters:
T - the type of elements.
All Known Subinterfaces:
ListProperty<T>, SetProperty<T>

@Incubating public interface HasMultipleValues<T>
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 ObjectFactory to create instances of this interface.

Since:
4.5
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    add(Provider<? extends T> provider)
    Adds an element to the property value.
    void
    add(T element)
    Adds an element to the property value.
    void
    addAll(Iterable<? extends T> elements)
    Adds zero or more elements to the property value.
    void
    addAll(Provider<? extends Iterable<? extends T>> provider)
    Adds zero or more elements to the property value.
    void
    addAll(T... elements)
    Adds zero or more elements to the property value.
    void
    set(Iterable<? extends T> elements)
    Sets the value of the property the elements of the given iterable.
    void
    set(Provider<? extends Iterable<? extends T>> provider)
    Sets the property to have the same value of the given provider.
  • Method Details

    • set

      void set(@Nullable Iterable<? extends T> elements)
      Sets the value of the property the elements of the given iterable. This property will track the value of the iterable and query its value each time the value of this property is queried.

      This method can also be used to clear the value of the property, by passing null as the value.

      Parameters:
      elements - The elements, can be null.
    • set

      void set(Provider<? extends Iterable<? extends T>> provider)
      Sets the property to have the same value of the given provider. This property will track the value of the provider and query its value each time the value of this property is queried. When the provider has no value, this property will also have no value.
      Parameters:
      provider - Provider of the elements.
    • add

      void add(T element)
      Adds an element to the property value.
      Parameters:
      element - The element
    • add

      void add(Provider<? extends T> provider)
      Adds an element to the property value.

      The given provider will be queried when the value of this property is queried. This property will have no value when the given provider has no value.

      Parameters:
      provider - The provider of an element
    • addAll

      void addAll(T... elements)
      Adds zero or more elements to the property value.
      Parameters:
      elements - The elements to add
      Since:
      4.10
    • addAll

      void addAll(Iterable<? extends T> elements)
      Adds zero or more elements to the property value.

      The given iterable will be queried when the value of this property is queried.

      Parameters:
      elements - The elements to add.
      Since:
      4.10
    • addAll

      void addAll(Provider<? extends Iterable<? extends T>> provider)
      Adds zero or more elements to the property value.

      The given provider will be queried when the value of this property is queried. This property will have no value when the given provider has no value.

      Parameters:
      provider - Provider of elements