Comment Comment by kriiuuu Good news is that you can achieve this with relatively little boilerplate in Java with sealed interfaces and records now. Relative to Java that is parent kriiuuu 2 years ago