T
- The type of value obtained from this source.P
- The source specific parameter type.@Incubating public interface ValueSource<T,P extends ValueSourceParameters>
ProviderFactory.of(Class, Action)
Modifier and Type | Method | Description |
---|---|---|
P |
getParameters() |
The object provided by
ValueSourceSpec.getParameters() when creating a provider from the value source. |
T |
obtain() |
Obtains the value from the source.
|
@Inject P getParameters()
ValueSourceSpec.getParameters()
when creating a provider from the value source.
Do not implement this method in your subclass.
Gradle provides the implementation when creating a provider from the value source via ProviderFactory.of(Class, Action)
.
@Nullable T obtain()
This method must be implemented in the subclass.
This method is only called if the provider value is requested and only once in that case.
null
if the value is not present.