y
06/28/2025, 6:13 AMenum class Names(val name: String)
(or a sealed interface
, etc.) but is instead
public class Generated {
public static final String names[] = new String[] { /* ... */ }
// repeat this line for each String in `names`, where the name of the const is the String, and `i` is the index into `names`
public static final int NAME = i;
}
is there a way of generating an `enum class`/`sealed interface` from this? for example, to exhaustively match on in when
expressions.loke
06/28/2025, 2:27 PMy
06/28/2025, 2:42 PMChrimaeon
06/29/2025, 9:00 AMStephan Schröder
06/30/2025, 10:21 PMenum class Generated(val name: String) {
first("1"),
second("2"),
third("3")
}