# value

abstract fun value(@Nullable value: T): Property<T>(source)

Sets the value of the property to the given value, replacing whatever value the property already had. This is the same as set but returns this property to allow method chaining.

This method can also be used to discard the value of the property, by passing it `null`. When the value is discarded (or has never been set in the first place), the convention (default value) for this property, if specified, will be used to provide the value instead.

#### Return

this

#### Since

5.0

#### Parameters

value

The value, can be null.

abstract fun value(provider: Provider<out T>): Property<T>(source)

Sets the property to have the same value as the given provider, replacing whatever value the property already had. 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. This is the same as set but returns this property to allow method chaining.

This method can NOT be used to discard the value of the property. Specifying a `null` provider will result in an `IllegalArgumentException` being thrown. When the provider has no value, this property will also have no value - regardless of whether or not a convention has been set.

When the given provider represents a task output, this property will also carry the task dependency information from the provider.

#### Return

this

#### Since

5.6

#### Parameters

provider

The provider whose value to use.