Search code examples
javaintellij-ideagetter-setter

IntelliJ getter/setter format (single-line versus multi-line)


How can you get IntelliJ to generate getter/setters accessor methods on one line like this:

public String getAbc() { return abc; }

… instead of multiple lines like this:

public String getAbc() {
   return abc;
}

Solution

  • There are no templates neither for getters nor for equals/hashcode. These are hardcoded in IDEA.

    Source

    You can see that in this IntelliJ Wishlist