Configure getter and setter IntelliJ code generation

I use to define member variables that are private with the prefix "m". Example:

private boolean mDone; 

A getter / setter will usually look like this:

 public boolean getDone() } return mDone; } public void setDone(boolean done) { mDone = done; } 

The Intellij IDE has a way to create these getters / seters, but it adds the prefix 'm' to the getter / setter method names. Is there any way to prevent this?

+6
source share
2 answers

In my IntelliJ 15.0.3, I can go to:

 File -> Settings -> Editor -> Code Style -> Java -> Code Generation 

and set the "Name Prefix" to m in the Naming panel:

enter image description here

+2
source

Decision:

  • Go to File -> Other Settings -> Default Settings
  • In the search box, enter "prefix" .
  • On the right, select the "Code Generation" .
  • In the "prefix" field "prefix" delete m (or any other prefix)
0
source

All Articles