Java proposal would streamline record creation
In an effort to streamline code, Java would be enhanced with derived record creation, via a proposal that would provide a means to create record instances from existing records through a block of transformation code.
The OpenJDK proposal authored by Oracle technical staff, titled “Derived Record Creation,” would streamlinescode by deriving a new record from an existing record, updating only components that need to change. The proposal notes that because records are immutable values, developers frequently build new records to reflect new data. The feature would enter Java in a preview state.