Suzan Cioc
Suzan Cioc

Reputation: 30097

Change eclipse template for setter so that actual parameter be named 'value'?

I want setters coded like this:

private String name;

public void setName(String value) {
    this.name = value;
}

but if I program eclipse template like this

${field} = value;

I get the following wrong code:

private String name;

public void setName(String name) {
    this.name = value;
}

How to accomplish?

Upvotes: 0

Views: 223

Answers (2)

Torsten
Torsten

Reputation: 6204

It is not possible to accomplish this as you can only influence the body of the setter, not the signature.

Upvotes: 1

HRgiger
HRgiger

Reputation: 2790

My configuration as below:

${field} = ${param};

Upvotes: 1

Related Questions