@Incubating interface SetProperty<T : Any> : Provider<MutableSet<T>>, HasMultipleValues<T>
Represents a property whose type is a Set of elements of type T. Retains iteration order.
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 org.gradle.api.model.ObjectFactory#setProperty(Class)
.
Since
4.5
abstract fun add(element: T): Unit
Adds an element to the property value. abstract fun add(provider: Provider<out T>): Unit
Adds an element to the property value. The given provider will be queried when the value of the property is queried. The property will have no value when the given provider has no value. |
|
abstract fun addAll(provider: Provider<out MutableIterable<T>>): Unit
Adds zero or more elements to the property value. The given provider will be queried when the value of the property is queried. The property will have no value when the given provider has no value. |
|
abstract fun get(): T
Returns the value of this provider if it has a value present, otherwise throws |
|
abstract fun getOrElse(defaultValue: T): T
Returns the value of this provider if it has a value present. Returns the given default value if a value is not available. |
|
abstract fun getOrNull(): T
Returns the value of this provider if it has a value present. Returns |
|
abstract fun isPresent(): Boolean
Returns |
|
abstract fun <S : Any> map(transformer: Transformer<out S, in T>): Provider<S>
Returns a new Provider whose value is the value of this provider transformed using the given function. The new provider will be live, so that each time it is queried, it queries this provider and applies the transformation to the result. Whenever this provider has no value, the new provider will also have no value. Note that the new provider may cache the result of the transformations and so there is no guarantee that the transformer is called on every query of the new provider. The new provider will apply the transformation lazily, and calculate the value for the new provider when queried. |
|
abstract fun set(value: MutableIterable<T>): Unit
Sets the value of the property the given value. This method can also be used to clear the value of the property, by passing abstract fun set(provider: Provider<out MutableIterable<T>>): Unit
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 the property is queried. When the provider has no value, this property will also have no value. |