Class RecordPatternsSecondPreviewExamples
java.lang.Object
net.jrodolfo.java_evolution.java20.RecordPatternsSecondPreviewExamples
Demonstrates record patterns as refined in the Java 20 second preview.
Record patterns reduce the gap between declaring transparent data with records and extracting that data later. Java 20 refined the preview, especially around nested record patterns, so code can match a structure and bind its interesting pieces in one place.
Record patterns became final in Java 21. This project compiles on JDK 25, so the example uses final syntax while documenting the Java 20 preview status.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordAddress record nested insideRecordPatternsSecondPreviewExamples.Customer.static final recordCustomer record used to demonstrate nested record deconstruction. -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
RecordPatternsSecondPreviewExamples
public RecordPatternsSecondPreviewExamples()
-
-
Method Details
-
describe
-