Interface ListProperty<T>
- Type Parameters:
T- the type of elements.
- All Superinterfaces:
HasConfigurableValue, HasMultipleValues<T>, Provider<List<T>>
Represents a property whose type is a
List of elements of type T.
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
Modifier and TypeMethodDescriptionconvention(Iterable<? extends T> elements) Specifies the value to use as the convention for this property.convention(Provider<? extends Iterable<? extends T>> provider) Specifies the provider of the value to use as the convention for this property.empty()Sets the value of this property to an empty collection, and replaces any existing value.Sets the value of the property to the elements of the given iterable, and replaces any existing value.Sets the property to have the same value of the given provider, and replaces any existing value.Methods inherited from interface HasConfigurableValue
disallowChangesMethods inherited from interface HasMultipleValues
add, add, addAll, addAll, addAll, finalizeValue, set, set
-
Method Details
-
empty
ListProperty<T> empty()Sets the value of this property to an empty collection, and replaces any existing value.- Specified by:
emptyin interfaceHasMultipleValues<T>- Returns:
- this property.
-
value
Sets the value of the property to the elements of the given iterable, and replaces any existing value. This property will query the elements of the iterable each time the value of this property is queried.This is the same as
HasMultipleValues.set(Iterable)but returns this property to allow method chaining.- Specified by:
valuein interfaceHasMultipleValues<T>- Parameters:
elements- The elements, can be null.- Returns:
- this
-
value
Sets the property to have the same value of the given provider, and replaces any existing value. 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.This is the same as
HasMultipleValues.set(Provider)but returns this property to allow method chaining.- Specified by:
valuein interfaceHasMultipleValues<T>- Parameters:
provider- Provider of the elements.- Returns:
- this
-
convention
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:
conventionin interfaceHasMultipleValues<T>- Parameters:
elements- The elements- Returns:
- this
-
convention
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:
conventionin interfaceHasMultipleValues<T>- Parameters:
provider- The provider of the elements- Returns:
- this
-