commonMain.net.iriscan.sdk.iris.exts.IrisEnumExtentions.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of biometric-sdk Show documentation
Show all versions of biometric-sdk Show documentation
Biometric SDK Kotlin Multiplatform library (android + ios)
package net.iriscan.sdk.iris.exts
/**
* @author Anton Kurinnoy
*/
interface Identifiable {
val value: Int
}
inline fun findEnumById(value: Int): T where T : Enum, T : Identifiable =
enumValues().find { it.value == value } ?: throw IllegalArgumentException("Enum not found")