For AI agents: the documentation index is at https://docs.gradle.org/llms.txt. Request any page with the header Accept: text/markdown to get Markdown. User manual pages are also available as Markdown by replacing .html with .md in the URL.

presentIfNotNull

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

Returns a Provider that is always present when the given value is non-null, or always absent otherwise, as if created by present or absent respectively.

Return

The provider. Never returns null.

Since

9.9.0

Parameters

value

The value of the provider. May be null.

<T>

the type of the value of the provider

See also