Java developers would gain an easier way to create records, and more streamlined code for declaring record classes, through derived record creation, a preview language feature being considered by the OpenJDK community.
Derived record creation would allow developers to create new records from existing records, specifying only the components that are different. Goals of the proposal include providing a concise means to create new record values from existing ones and streamlining the declaration of record classes by eliminating the need to provide explicit wither methods, which are the immutable analogue of setter methods.
To read this article in full, please click here
InfoWorld
Article Categories:
Uncategorized