Search code examples
javaintellij-idearefactoringintellij-13parameter-object

Introduce parameter object refactoring in IntelliJ 13


I would like to perform an automatic "Introduce parameter object" refactoring in IntelliJ IDEA 13.1. It seems that this refactoring was available in version 10.5, according to this page, but I can't seem to find it in the current version.

In a nutshell, I want IntelliJ to create a class encapsulating a series of parameters of a method, and replace the parameters with an instance of that type.

Is this refactoring really no longer available?


Solution

  • Place the cursor on the method and from the top menu choose Refactor -> Extract -> Parameter Object. In the dialog that's opened, choose the class' name, package etc. and press "Refactor".