Builder Generator

Compatible with: IntelliJ IDEA Android Studio
Sep 16, 2017
102 670
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 file:
    • creates a builder if it does not exist
    • switches between class and builder if builder exists
  • Code | Generate menu (ALT+Insert) from a class:
    • creates a builder if it does not exist
    • regenerates builder if it exists

Download plugin

Recent change notes

version 1.1.7
  • Added best constructor selection in order to prevent generation of faulty constructor in build() method (contribution by mkickax)
  • Fixed missorted parameters in constructor (issue #35) (contribution by mkickax)
  • Fixed inline return statement when using constructor only in build() method (issue #26) (contribution by mkickax)
version 1.1.6
  • Added ability to regenerate an existing builder, by automatically deleting the previous builder and creating a new one (issue #18) (contribution by mkickax)
  • Builder Generator is now also available from Code | Generate menu (issue #20) (contribution by mkickax)
version 1.1.5
  • Added ability to generate builder using a single field (the object to be built itself) instead of all fields of the object to be built (issue #37) (contribution by mkickax)
version 1.1.4
version 1.1.3
  • Fix incompatibility with IntelliJ 2017.1 (issue #33)
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
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