typesetter:
public Object set$localname$ ($type$ $localname$) { this.$localname$ = $localname$; return this; } typesetter:
public Object set$localname$ ($type$ $localname$) { this.$localname$ = $localname$; return this; } When generating a setter, you can choose the builder template instead of the default, and best of all, use lombok
When you select the autocreate setter ( Code -> Generate -> Setter or ALT + Insert ), the create setter window appears:
You can click on the three dots icon, to the right of the line with the selection of a template ( Template:) and in the wizard that appears, click on the plus sign in the upper left and set your own arbitrary setter generation template.
There is already a ready template for generating a setter for the Builder pattern - you can select it in the Template drop-down list: Builder
Source: https://ru.stackoverflow.com/questions/516756/
All Articles
planet:planet1.setMass(300).setVelocity(3000).setEccentricity(1.3d);That is, to do several sets in one line. - Herrgott