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. The nested record-pattern syntax shown here remains faithful to the Java 20 second preview while documenting its 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
-