A hands-on exploration of modern Java features pushed to their limits, covering expandable sealed type hierarchies using non-sealed interfaces, nested switches as self-documenting code, reverse instanceof pattern for guard-style validation, stream filtering by type using flatMap, pattern matching over Optional via a custom sealed Option type, and text block tricks for controlling line endings and indentation.

15m read timeFrom nipafx.dev
Post cover image
Table of contents
▚ Intro▚ Expandable Sealed Types▚ Nesting Switches▚ Reverse Instanceof▚ Stream Filter By Type▚ Ad Break!▚ Switching Over Optional▚ Text Block Line Endings▚ Good Or Dirty?

Sort: