All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.net.iriscan.sdk.iris.exts.IrisEnumExtentions.kt Maven / Gradle / Ivy

There is a newer version: 0.6.0
Show newest version
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")




© 2015 - 2024 Weber Informatics LLC | Privacy Policy