T
- Type of value represented by provider@Incubating public interface Provider<T>
get()
or getOrNull()
.
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 methods Project.provider(java.util.concurrent.Callable)
or
ProviderFactory.provider(java.util.concurrent.Callable)
.
Modifier and Type | Method and Description |
---|---|
T |
get()
If a value is present in this provider, returns the value, otherwise throws
java.lang.IllegalStateException . |
T |
getOrNull()
Returns the value if present in this provider.
|
boolean |
isPresent()
Returns
true if there is a value present, otherwise false . |
T get()
java.lang.IllegalStateException
.IllegalStateException
- if there is no value present@Internal @Nullable T getOrNull()
@Internal boolean isPresent()
true
if there is a value present, otherwise false
.true
if there is a value present, otherwise false