Reputation: 663
Is is possible using lombok to set the input variable of a @Setter method to be final.
For example
public void setCarName(final String carName){
this.carName = carName;
}
I don't know if this is even possible could not see it in the documentation.
Upvotes: 2
Views: 2070
Reputation: 212
Why would you even be worried about this? Making it final only prevents you from reinitializing the variable, i.e. carName = "foo"
or carName = new String("foo")
. Since the code generated by lombok does not attempt to do this marking it as final is completely unneccesary.
Upvotes: 1
Reputation: 10725
Probably it's not possible.
The only advantage of making final
this parameter is to improve readability, which makes no sense on code that will not be read.
Upvotes: 3