takeIf
Returns
this
value if it satisfies the given
predicate
or
null
, if it doesn't.
For detailed usage information see the documentation for scope functions .