Encapsulate Fields dialog
Last modified: 10 August 2022Refactor | Encapsulate Fields
Item | Description |
---|---|
Fields to encapsulate | In this area select the fields you want to create accessors for. You can accept the default method names or change them at will. If a method with the same signature is already present in the class to be refactored, the Method icon |
Get access/Set access | Use this option group to select which accessor methods (Getter, Setter or both) will be created for the selected fields. If one of the checkboxes is cleared, the entire corresponding column (Getter or Setter) in the Fields to Encapsulate table is disabled. |
Encapsulated Fields' Visibility | Here you can specify the new visibility scope for the selected fields |
Options | Select whether you want to use accessors even when field is accessible or not. If the option Use accessors even when the field is accessible is not checked, the references to the desired fields, when the fields are directly accessible, will not change. Otherwise, all references to the desired fields will be replaced with the accessor calls. It also depends on your selection in the options group Encapsulated Fields' Visibility. For example, if you uncheck the option Use accessors even when the field is accessible, and select the private visibility for the fields, the usages of the fields outside the class will change, but within the class they will remain the same. |
Accessors' Visibility | In this area select the visibility scope for the created accessor methods. |
Thanks for your feedback!