IntelliJ IDEA 2021.2 Help

Extract Parameter Object Dialog

Refactor | Extract | Parameter Object

Use this refactoring to create a wrapper class around some selected parameters of a method, or use a compatible existing class as a wrapper.

Item

Description

Method to extract parameters from

This read-only field shows the name of the selected method.

Parameter Class

Use this section to specify whether you want to create a new wrapper class or use an existing one.

Create new class

Click this radio-button to move parameters of a method to a new class. If this option is selected, specify the class and destination package name in the fields below. By default, current package name is displayed. You can type a different package name in the text field, or click the ellipsis button and select the destination package from the tree view. If the desired package doesn't exist, click Icons actions new folder to create a new one.

Create inner class

Click this radio-button to move parameters of a method to an inner class. If this option is selected, specify the class name in the field below.

Use existing class

Click this radio-button to move parameters of a method to an existing class of your choice. You can type the fully-qualified class name in the text field, or click the ellipsis button and choose the desired class in the Select parameter class dialog box. Note that you can select the desired wrapper class both from the project and non-project classes.

Parameters to extract

Use checkboxes in this section to select which parameters of a method should be extracted into separate object.

Move Up / Move Down

Use these buttons to move the selected reorder parameters in the list.

Keep method as delegate

If this checkbox is selected, the original method will be preserved as a delegate to the newly created method.

Last modified: 02 August 2022