LetExtensionNullable<T extends Object> extension
Kotlin-style let helpers for nullable types.
- on
-
- T?
Methods
-
also(
void block(T it)) → T? -
Available on T?, provided by the LetExtensionNullable extension
Executesblockwhen non-null and returns the original receiver. -
let<
R> (R block(T it)) → R? -
Available on T?, provided by the LetExtensionNullable extension
Executesblockwhen the receiver is non-null, returning its result. -
letNullable<
R> (R? block(T? it)) → R? -
Available on T?, provided by the LetExtensionNullable extension
Back-compat variant whoseblockaccepts a nullable receiver. -
letOr<
R> (R block(T it), {required R defaultValue}) → R -
Available on T?, provided by the LetExtensionNullable extension
Executesblockwhen non-null, otherwise returnsdefaultValue. -
takeIf(
bool predicate(T it)) → T? -
Available on T?, provided by the LetExtensionNullable extension
Returns the receiver if non-null and it satisfiespredicate, elsenull. -
takeUnless(
bool predicate(T it)) → T? -
Available on T?, provided by the LetExtensionNullable extension
Returns the receiver if non-null and it does NOT satisfypredicate, elsenull.