apply If
Applies the given block if the if value is true, only return the object itself if not.
Return
This instance.
Parameters
if
Whether the block should be applied.
block
The block to be applied.
inline fun <T> T.applyIf(ifPredicate: T.() -> Boolean, block: T.() -> Unit): T
Content copied to clipboard
Applies the given block if the ifPredicate results to true, only return the object itself if not.
Return
This instance.
Parameters
if Predicate
Results to whether the block should be applied.
block
The block to be applied.