The question
How do I configure automatically generated setter stuff in Eclipse?
Specifically, how do I configure stuff in the following list?
- Make the setter parameter
final
. - Use the name
newValue
as the parameter name. - Don't use
this.
when in the assignment.
Explanation
Currently, Eclipse generates setters like this:
private String blammo;
public void setBlammo(String blammo)
{
this.blammo = blammo;
}
I would like to configure Eclipse to generate setters like this:
private String hooty;
public void setHooty(final String newValue)
{
hooty = newValue;
}
Edit:
Why, you say?
This is strictly my opinion.
- Final parameters = good. Not final parameters = careless.
newValue
makes sense and fits well with #3 below. Do you really need to identify the value that thesetHooty
method will be setting? If yes, then your code has issues.this.hooty
; why usethis
to reference my own menbers? I believe it adds no value and thus serves only to obfuscate the code.