gradle
Toggle table of contents
9.6.0-20260414005124+0000
API
Target filter
API
Switch theme
Search in API
Skip to content
gradle
gradle
/
org.gradle.api.tasks
/
TaskProvider
Task
Provider
API
interface
TaskProvider
<
T
:
Task
?
>
:
NamedDomainObjectProvider
<
T
>
(
source
)
Providers a task of the given type.
Since
4.8
Parameters
<T>
Task type
Members
Functions
configure
Link copied to clipboard
API
abstract
fun
configure
(
action
:
Action
<
in
T
>
)
Configures the task with the given action.
filter
Link copied to clipboard
API
@
Incubating
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.
flat
Map
Link copied to clipboard
API
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.
get
Link copied to clipboard
API
abstract
fun
get
(
)
:
T
Returns the value of this provider if it has a value present, otherwise throws
java.lang.IllegalStateException
.
get
Name
Link copied to clipboard
API
abstract
fun
getName
(
)
:
String
The task name referenced by this provider.
get
Or
Else
Link copied to clipboard
API
abstract
fun
getOrElse
(
defaultValue
:
T
)
:
T
Returns the value of this provider if it has a value present.
get
Or
Null
Link copied to clipboard
API
@
Nullable
abstract
fun
getOrNull
(
)
:
@
Nullable
T
Returns the value of this provider if it has a value present.
is
Present
Link copied to clipboard
API
abstract
fun
isPresent
(
)
:
Boolean
Returns
true
if there is a value present, otherwise
false
.
map
Link copied to clipboard
API
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.
or
Else
Link copied to clipboard
API
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.
zip
Link copied to clipboard
API
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.