I have a question about `enums`. I have defined on...
# announcements
m
I have a question about
enums
. I have defined one that looks like this
Copy code
enum class ChartType(val value: String?) {
    Text("Text"),
    MAP("Map"),
    COLUMN("Column Style 1"),
and want to use this enum in a function like this:
Copy code
fun getType():ChartType {
        var type = ChartType(value = currentData?.visualizationName)
    }
But obviously have something wrong (Enums cannot be Instantiated). So my question is how do I do this properly? Do I have to make a
function
with a giant
switch statement
that takes a
String
and returns the
ChartType enum
or is there an better way.