-
-
Save skydoves/50ea151511c03ae908463792a4089f0c to your computer and use it in GitHub Desktop.
ui_version
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
enum class UiVersion(val value: Int) { | |
VERSION_1_0(1), | |
VERSION_2_0(2); | |
companion object { | |
fun toUiVersion(value: Int): UiVersion { | |
return when (value) { | |
VERSION_1_0.value -> VERSION_1_0 | |
VERSION_2_0.value -> VERSION_2_0 | |
else -> throw RuntimeException("undefined version!") | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment