Over a million developers have joined DZone.

Flesh Out Your Builder With Vim.

Create 'setters' for builder methods with vim. On each line, place 'type varname:

int foo
string bar

%s:\(\w\+\) \(\w\+\):public ClassIdBuilder \2(\1 value) {this.\2 = value; return this;}:

Copy assignments from builder to type. Each line is a variable name.

:%s:\(\w\+\):this.\1 = builder.\1;:

Opinions expressed by DZone contributors are their own.

The best of DZone straight to your inbox.

Please provide a valid email address.

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}