I would personally go down the ordinal path. ``` i...
# getting-started
b
I would personally go down the ordinal path.
Copy code
internal enum class People {
    MAN,
    BABY,
    WOMAN;

    companion object {
        operator fun get(ordinal: Int): People? {
            if (ordinal < 0 || ordinal >= values().size) {
                return null
            }

            return values()[ordinal]
        }
    }
}

fun print(ordinal: Int) {
    People.get(ordinal)?.let {
        print("converted successfully => $it")
    } ?: print("null value -> No Match")
}