Comment Comment by megawatthours 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. parent megawatthours 9 years ago
It generates code for algebraic data types which offer a typesafe interface similar to the `case` statements in languages that natively support pattern matching.