File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
clients/clearly-defined/src/main/kotlin Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,8 @@ enum class ComponentType(val defaultProvider: Provider? = null) {
43
43
44
44
companion object {
45
45
@JvmStatic
46
- fun fromString (value : String ) = ComponentType .entries.single { it.toString() == value }
46
+ fun fromString (value : String ) =
47
+ ComponentType .entries[ComponentType .serializer().descriptor.getElementIndex(value)]
47
48
}
48
49
49
50
// Align the string representation with the serial name to make Retrofit's GET request work. Also see:
@@ -73,7 +74,7 @@ enum class Provider {
73
74
74
75
companion object {
75
76
@JvmStatic
76
- fun fromString (value : String ) = Provider .entries.single { it.toString() == value }
77
+ fun fromString (value : String ) = Provider .entries[ Provider .serializer().descriptor.getElementIndex( value)]
77
78
}
78
79
79
80
// Align the string representation with the serial name to make Retrofit's GET request work. Also see:
You can’t perform that action at this time.
0 commit comments