Class RecordPatternsExamples
java.lang.Object
net.jrodolfo.java_evolution.java21.RecordPatternsExamples
Demonstrates record patterns, finalized in Java 21.
Records make transparent data carriers concise, but code often needs to read the components back out. Record patterns let code test the type and bind record components in one expression, which is especially useful for nested records.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final recordPoint record used by the nested deconstruction example.static final recordRectangle record made of two points. -
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
RecordPatternsExamples
public RecordPatternsExamples()
-
-
Method Details
-
describe
-