SetProperty

Represents a property whose type is a Set of elements of type T. Retains iteration order.

Instances of this interface are not thread-safe for reading and writing. It is not safe to share the same SetProperty instance between different projects.

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

Since

4.5

Parameters

<T>

the type of elements.

See also

Create an instance of this as a managed property (preferred).

Create an instance of this manually.

Functions

Link copied to clipboard
abstract fun add(element: T)
abstract fun add(provider: Provider<out T>)
Adds an element to the property value.
Link copied to clipboard
abstract fun addAll(elements: Array<T>)
abstract fun addAll(elements: Iterable<out T>)
abstract fun addAll(provider: Provider<out Iterable<out T>>)
Adds zero or more elements to the property value.
Link copied to clipboard
fun <T : Any> HasMultipleValues<T>.assign(elements: Iterable<T>?)

Sets the value of the property to the elements of the given iterable, and replaces any existing value

fun <T : Any> HasMultipleValues<T>.assign(provider: Provider<out Iterable<T>>)

Sets the property to have the same value of the given provider, and replaces any existing value

Link copied to clipboard
abstract fun convention(@Nullable elements: @Nullable Iterable<out T>): SetProperty<T>
Specifies the value to use as the convention for this property.
abstract fun convention(provider: Provider<out Iterable<out T>>): SetProperty<T>
Specifies the provider of the value to use as the convention for this property.
Link copied to clipboard
abstract fun disallowChanges()
Disallows further direct changes to this object.
Link copied to clipboard
abstract fun disallowUnsafeRead()
Disallows reading the value of this object when its value may not yet be available or may still change.
Link copied to clipboard
abstract fun empty(): SetProperty<T>
Sets the value of this property to an empty collection, and replaces any existing value.
Link copied to clipboard
abstract fun filter(spec: Spec<in T>): Provider<T>
Returns a new Provider with the value of this provider if the passed spec is satisfied and no value otherwise.
Link copied to clipboard
abstract fun finalizeValue()
Disallows further changes to the value of this property.
Link copied to clipboard
abstract fun finalizeValueOnRead()
Requests that the final value of this object be calculated on the next read of the value, if not already known.
Link copied to clipboard
abstract fun <S> flatMap(transformer: Transformer<out @Nullable Provider<out S>, in T>): Provider<S>
Returns a new Provider from the value of this provider transformed using the given function.
Link copied to clipboard
abstract fun get(): T
Returns the value of this provider if it has a value present, otherwise throws java.lang.IllegalStateException.
Link copied to clipboard
abstract fun getOrElse(defaultValue: T): T
Returns the value of this provider if it has a value present.
Link copied to clipboard
@Nullable
abstract fun getOrNull(): @Nullable T
Returns the value of this provider if it has a value present.
Link copied to clipboard
abstract fun isPresent(): Boolean
Returns true if there is a value present, otherwise false.
Link copied to clipboard
abstract fun <S> map(transformer: Transformer<out @Nullable S, in T>): Provider<S>
Returns a new Provider whose value is the value of this provider transformed using the given function.
Link copied to clipboard
abstract fun orElse(value: T): Provider<T>
Returns a Provider whose value is the value of this provider, if present, otherwise the given default value.
abstract fun orElse(provider: Provider<out T>): Provider<T>
Returns a Provider whose value is the value of this provider, if present, otherwise uses the value from the given provider, if present.
Link copied to clipboard
abstract fun set(@Nullable elements: @Nullable Iterable<out T>)
Sets the value of the property to the elements of the given iterable, and replaces any existing value.
abstract fun set(provider: Provider<out Iterable<out T>>)
Sets the property to have the same value of the given provider, and replaces any existing value.
Link copied to clipboard
abstract fun unset(): SetProperty<T>
Unsets this object's explicit value, allowing the convention to be selected when evaluating this object's value.
Link copied to clipboard
abstract fun unsetConvention(): SetProperty<T>
Unsets this object's convention value.
Link copied to clipboard
abstract fun value(@Nullable elements: @Nullable Iterable<out T>): SetProperty<T>
Sets the value of the property to the elements of the given iterable, and replaces any existing value.
abstract fun value(provider: Provider<out Iterable<out T>>): SetProperty<T>
Sets the property to have the same value of the given provider, and replaces any existing value.
Link copied to clipboard
abstract fun <U, R> zip(right: Provider<U>, combiner: BiFunction<in T, in U, out @Nullable R>): Provider<R>
Returns a provider which value will be computed by combining this provider value with another provider value using the supplied combiner function.