How to do reverse lookup enum constant by value in Kotlin

A common use case

A slightly better way using companion objects

java.lang.IllegalStateException: Look up failed for class experiments.MousesV1

--

--

--

Software Engineer In Test, I ❤️ to build scalable test automation frameworks and teams. Blog at automationhacks.io 🇮🇳 pronouns: he/him/his

Love podcasts or audiobooks? Learn on the go with our new app.

Python / Pandas & BigQuery in 7 minutes

Rust — print object addresses using {:p}

SwiftHeroes 2018 — Review

To invest, or not to invest? How to assess NFT projects.

new Easter eggs

Reduce, et. al.

How to debug? (Tips for newbies)

Dollaremon Swap launch!!

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Gaurav Singh

Gaurav Singh

Software Engineer In Test, I ❤️ to build scalable test automation frameworks and teams. Blog at automationhacks.io 🇮🇳 pronouns: he/him/his

More from Medium

Integration of Huawei Push Kit in Book Reading Android app (Kotlin) — Part 3

Analyzing the algorithmic complexity of the Kotlin API’s distinctBy function

Learn to perform Asynchronous operations in Android using RxJava in 10 mins

Another Performance Monitoring for Android apps