I have a small question regarding generated getter and setter methods in my domain objects. I want to use a common style guide for my source code. One part of that style guide says that I start each class member name with the prefix 'm' for member.
class User{
String mName;
List<Call> mAllCall;
List<Geo> mAllGeo;
Unfortunately I have a couple of classes with many more member variables. The problem I have is that I am a very lazy developer, and that I create the getter and setter methods in Eclipse with
"Source"->"Generate Getters and Setters".
The result is
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;
}
That 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 currently remove and replace the prefix in the method names by hand. Is there an easier way to do this?