applyIf

inline fun <T> T.applyIf(value: Boolean, block: T.() -> Unit): T

Executes block if value is true, else just returns this. Similar to apply, but executes conditionally.