The Art of Java Language Pattern Matching
Conference Room A
The goal of project Amber within OpenJDK is to explore the inclusion of
productivity-oriented Java language features. One part of this that has delivered
new functionality in recent versions is pattern matching.
Pattern matching combines application code logic to test if an expression has a
specific type or structure and extract components of its state for processing.
Pattern matching is now well embedded in the Java language using the following
features, defined by JDK Enhancement Proposals (JEPs)
Pattern matching for instanceof (JEP 305, 375, 394, 433)
Pattern matching for switch (JEP 406, 420, 427)
Record patterns (JEP 405,432)
In this session, we’ll look at the details of these two new language features and a
more general look at pattern matching. We’ll also explore future features in this area
such as array patterns, which may be included in a subsequent Java release.
By the end of the session, you’ll be ready to use these powerful new features.