akshattandon / projectlombok

Automatically exported from code.google.com/p/projectlombok
0 stars 0 forks source link

Provide option for @Value classes to remain non-final #774

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
It is understood that typically value/valjo classes should be made final, but 
the option should remain (probably as an attribute on the @Value annotation) to 
avoid making @Value-annotated classes final.

The reason for this is that one may wish to intentionally design a hierarchy of 
value/valjo types to avoid duplicating common structure and behavior. I just 
ran into this personally, and now must drop down to the lower-level annotations.

I see that this very question is the stated reason why @Value remains 
'experimental' (per http://projectlombok.org/features/experimental/Value.html). 
It was indeed surprising to me to see this functionality, and more surprising 
still that I didn't have a way to opt out of it.

Original issue reported on code.google.com by cbe...@gmail.com on 26 Jan 2015 at 6:24

GoogleCodeExporter commented 9 years ago
This is possible in the non-experimental version, see 
http://projectlombok.org/features/Value.html

You need to annotate the class with @NonFinal.

Original comment by r.spilker on 27 Jan 2015 at 2:00

GoogleCodeExporter commented 9 years ago
Oh and the documentation page you are referring to is outdated and even removed 
from our source repo; the deployment of the website however didn't remove stale 
files. We're planning to replace this page with a page similar to 
http://projectlombok.org/features/experimental/Builder.html

Original comment by r.spilker on 27 Jan 2015 at 2:03

GoogleCodeExporter commented 9 years ago
http://projectlombok.org/features/experimental/Value.html has been modified. 
You might need to refesh the page :-)

Original comment by r.spilker on 27 Jan 2015 at 3:29

GoogleCodeExporter commented 9 years ago
Thanks! Works as advertised.

Original comment by cbe...@gmail.com on 27 Jan 2015 at 6:16