Package org.gradle.api.provider
Interface Property<T>
-
- Type Parameters:
T
- Type of value represented by the property
- All Superinterfaces:
Provider<T>
- All Known Subinterfaces:
DirectoryProperty
,DirectoryVar
,ListProperty<T>
,PropertyState<T>
,RegularFileProperty
,RegularFileVar
@Incubating public interface Property<T> extends Provider<T>
AProvider
representation for capturing the state of a property. The value can be provided by using the methodset(Object)
orset(Provider)
.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.property(Class)
. There are also several specialized subtypes of this interface that can be created using various other factory methods.- Since:
- 4.3
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
set(Provider<? extends T> provider)
Sets the property to have the same value of the given provider.void
set(T value)
Sets the value of the property the given value.
-
-
-
Method Detail
-
set
void set(@Nullable T value)
Sets the value of the property the given value.This method can also be used to clear the value of the property, by passing
null
as the value.- Parameters:
value
- The value, can be null.
-
set
void set(Provider<? 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 the property is queried. When the provider has no value, this property will also have no value.- Parameters:
provider
- Provider
-
-