|
|
|
|
|
by megawatthours
3343 days ago
|
|
You can do this in Java using derive4j: https://github.com/derive4j/derive4j. It generates code for algebraic data types which offer a typesafe interface similar to the `case` statements in languages that natively support pattern matching. |
|