Skip to content

Instantly share code, notes, and snippets.

@nejckorasa
Last active August 17, 2018 08:36
Show Gist options
  • Select an option

  • Save nejckorasa/cc8f2c1f445010354f060bc1a1e8c24f to your computer and use it in GitHub Desktop.

Select an option

Save nejckorasa/cc8f2c1f445010354f060bc1a1e8c24f to your computer and use it in GitHub Desktop.
Usefull Kotlin extension functions
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