Builder Generator
for IntelliJ IDEA

Compatible with  IntelliJ IDEA
56 662
Adds ability to generate builder for a class and switch between them. Switching between builder and source class is similar to 'Go To Test' action. Generated builder class does not use reflection, only setter methods or constructor. Usage:
  • ALT+SHIFT+B inside a class.

Download plugin

Recent change notes

version 1.1.2
  • Inner builder is able to assign fields without constructor or setter (issue #11) (contribution by blindpirate)
version 1.1.1
  • 'but' method is now optional and disabled by default (issue #23)
  • Generated builder class is final (issue #24)
  • Added possibility to find inner builder
version 1.1.0
  • Added possibility to generate builder as inner class (issue #13)
version 1.0.11
  • Added 'but' method generation (issue #10)
  • Fix for deadlock on startup (issue #12)
  • Fix for method name generation (issue #14)
version 1.0.10
  • Support for Code Style field and parameter prefixes (issue #9)
version 1.0.9
  • Added customizable prefix for builder method (contribution by Bjorn Monnens)
version 1.0.8
  • Comments are no longer copied when creating builder(issue #5)
  • Compiled for Java 6 (issue #6)
version 1.0.7
  • Attempt to fix a bug that caused deadlock during IDEA startup (issue #4)
version 1.0.6
  • Fixed bug that prevented generating builder in multimodule project
version 1.0.5
  • Added action to 'Navigate' menu (can be easier found in 'Find Action' box)
version 1.0.4
  • Fixed bug that prevented generating builder for class that was added as a project dependency
version 1.0.3
  • Added ability to create builder for class with fields initialized in constructor
version 1.0.2
  • Updated for IDEA 11.0
version 1.0.1
  • Annotations of fields are now ignored when creating a builder
  • Source class in builder is no longer a field, but a local variable in build() method

General usage instructions

ALT+SHIFT+B inside a class
I want to love this, but unfortunately it only seems to work off fields and not existing setters, which means it's not useful for my use case where the underlying structure is a Map and the setters put the values to known keys. Any chance of getting this functionality sometime?
The description reads as "Generated builder class does not use reflection, only 'setter methods' or constructor." I have a class with no constructor but setter methods only. I get an empty list in "Select Fields to Be Available in Builder" popup. Am I missing something? Or having a constructor is mandatory for it to work?
This is really good. Have you thought of adding Objects.requireNonNull as a way to enforce non null fields and checks on the Build()? if you need some, would love to help. Cheers,
Fields are all generated on the same line. Generated constructor passes arguments in the order that fields are declared, rather than the order that the constructor takes the arguments.
Can't figure out how to use this in an OS X installation of Idea
Perfect!! Thanks
Very nice and simple plugin, works as expected. Thanks!
Please  sign in  to leave a comment.