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