I have a little question regarding the generated getter and setter methods in my domain objects. I want to use a common style for my source code. One part of this style guide says that I start each class member name with the 'm' prefix for the member.
class User{ String mName; List<Call> mAllCall; List<Geo> mAllGeo;
Unfortunately, I have a couple of classes with many other member variables. The problem is that I am a very lazy developer, and that I create getter and setter methods in Eclipse using
Source β Generate Recipients and Setters.
Result
public String getmName() { return mName; } public void setmName(String mName) { this.mName = mName; } public List<Call> getmAllCall() { return mAllCall; } public void setmAllCall(List<Call> mAllCall) { this.mAllCall = mAllCall; } public List<Geo> getAllGeo() { return mAllGeo; } public void setmAllGeo(List<Geo> mAllGeo) { this.mAllGeo = mAllGeo; }
This is not the result I want. I need this:
public String getName() { return mName; } public void setName(String pName) { this.mName = pName; } public List<Call> getAllCall() { return mAllCall; } public void setAllCall(List<Call> pAllCall) { this.mAllCall = pAllCall; } public List<Geo> getAllGeo() { return mAllGeo; } public void setmAllGeo(List<Geo> pAllGeo) { this.mAllGeo = mAllGeo; }
I am currently deleting and replacing the prefix in the method names manually. Is there an easier way to do this?
source share