Pattern Matching in Java: Better Code, Better APIs

Switch and instanceof have been the gates of data introspection in Java since 1.0. In modern times, these constructs have evolved to enable full-blown pattern matching, empowering Java developers to write cleaner implementation code. Looking ahead, the future of pattern matching will not only focus on writing better implementation code but also on crafting more intuitive APIs. This evolution is closely tied to upcoming innovations like the new design of serialization, which leverages pattern matching to simplify and secure data transformations. In this talk, we will explore the current role of switch and instanceof and discuss how pattern matching may shape the future of both API development and Java’s core features, such as serialization.

Make sure to check the JavaOne 2025 playlist.