Last active
August 17, 2018 08:36
-
-
Save nejckorasa/cc8f2c1f445010354f060bc1a1e8c24f to your computer and use it in GitHub Desktop.
Usefull Kotlin extension functions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| inline fun <T> T.throwIf(predicate: (T) -> Boolean, throwBlock: (T) -> Exception): Unit = if (predicate(this)) throw throwBlock(this) else Unit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment