Hi
when using a framework the final constraint can be quite intrusive so having a
@Value(useFinal=false)
would be very welcomed
It is impossible to guarantee that a non-final class is actually immutable, which is the whole point of @Value. Why not just use @Data?
@rschmitt agree, even the exact reason why @Value fails when used with such frameworks. Goal is mainly to not expose setters at all. @Data(readOnly=true) would work also but sounds better on @Value IMHO. Idea being to avoid to add yet another annotation (@Setter) on all "value" objects.
@NonFinal is already available.
Correct
As documented on the @Value page adding @NonFinal on the type gives you the desired behavior.
@rspilker does tht make the fields nonfinal too?
@rspilker does that make the fields nonfinal too?
It does not. Fields stay final.
Most helpful comment
As documented on the
@Valuepage adding@NonFinalon the type gives you the desired behavior.