8 ms·
FYI: With Java 21 (2023/09/19) this is finally possible. Relevant JEPs: - 441: Pattern Matching for switch - 440: Record Patterns - 409: Sealed Classes - 3
by spreiti 3y ago
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.
- isbvhodnvemrwvn 3y agoAnd 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.