ru.inforion.lab403.common.extensions.enums.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kotlin-extensions Show documentation
Show all versions of kotlin-extensions Show documentation
Kotlin extension methods and function for different Java libraries
package ru.inforion.lab403.common.extensions
/**
* Created by Alexei Gladkikh on 02/03/17.
*/
inline fun > find(predicate: (item: T) -> Boolean): T? = enumValues().find { predicate(it) }
inline fun > first(predicate: (item: T) -> Boolean): T = enumValues().first { predicate(it) }
inline fun > convert(ord: Int): T = enumValues()[ord]