Closed GoogleCodeExporter closed 9 years ago
[deleted comment]
resolved, see: https://github.com/tgerder/lombok
Original comment by ralfw...@gmail.com
on 14 Jan 2015 at 6:21
The spec of @Value is explicit in saying that it implies @AllArgsConstructor.
We could discuss if this is a sensible default, but I posit that it is a mostly
irrelevant exotic detail that's not worth the time it would take to discuss it
in detail.
Furthermore even if defaulting to @RequiredArgsConstructor would be a better
idea than defaulting to @AllArgsConstructor, the difference is so tiny, it'll
never even get close to crossing the bar required to make a backwards
incompatible change to the specification at this point in time. Therefore, the
discussion is definitely not worth having.
Enhancement request therefore denied.
NB: I don't know enough about the Pojo you are making to be sure, but there are
3 alternate routes to solve your problem:
* Perhaps @Data is more appropriate than @Value, here.
* If s2 is a transient-style internal cache fields, consider naming it '$s2'
instead; that way, lombok ignores it entirely; it will not be included in the
constructor, and no getter will be generated for it. hashCode and equals and
toString will also all ignore it.
* Just write '@lombok.Value @lombok.RequiredArgsConstructor', that works fine.
Original comment by reini...@gmail.com
on 29 Jan 2015 at 7:53
Original issue reported on code.google.com by
ralfw...@gmail.com
on 14 Jan 2015 at 1:27