Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

FYI: With Java 21 (2023/09/19) this is finally possible.

Relevant JEPs:

- 441: Pattern Matching for switch

- 440: Record Patterns

- 409: Sealed Classes

- 395: Records

It is kind of similar to Scalas version of pattern matching with case classes.



And it won't get adopted any time soon due to backwards compatibility and existing code. Anybody who wanted to use it used vavr at this point.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: