Enhancement for Getter-Setter generation

Issue #2567 open
Eric Kintzer created an issue

I use this feature all the time yet I’m doing after-the-fact editing to make it conform to the style I prefer

Enhancement Idea One: generate all the Getters together, then all the Setters

Why - it is easier to read, a column of getXXX followed by a column of withXXX. I keep my properties in alpha order

Example:

public String getCreator() { return creator; }
public String getCustomerEmail() { return customerEmail; }

public PublicLicenseCrudDetail withCreator(String creator) { this.creator = creator; return this; }
public PublicLicenseCrudDetail withCustomerEmail(String customerEmail) { this.customerEmail = customerEmail; return this; }

Enhancement Idea Two: One-line withXXX methods

Why – saves on class lines/scrolling for basically dumb methods that always follow a pattern. You do this for getters (much appreciated), not for withXXX

Example: see Idea One

Enhancement Idea Three (minor) - Replace the setter method argument with val

Why: Saves horizontal space; method name already tells you what the argument should be

Example:

public PublicLicenseCrudDetail withCreator(String val) { this.creator = val; return this; }
public PublicLicenseCrudDetail withCustomerEmail(String val) { this.customerEmail = val; return this; }

Comments (2)

  1. Log in to comment