From b439e4ce771813a12300c3006f9fcc12f25678d7 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Tue, 16 Jul 2019 01:24:18 +0200 Subject: [Fixes #2115] builder fields tracking a property that has a default set is now called `$value` in order to convey that you shouldnt manually mess with it. --- website/templates/features/Builder.html | 2 ++ 1 file changed, 2 insertions(+) (limited to 'website') diff --git a/website/templates/features/Builder.html b/website/templates/features/Builder.html index af1ffd3a..30e00ce0 100644 --- a/website/templates/features/Builder.html +++ b/website/templates/features/Builder.html @@ -191,6 +191,8 @@ public class JacksonExample { With toBuilder = true applied to methods, any type parameter of the annotated method itself must also show up in the return type.

The initializer on a @Builder.Default field is removed and stored in a static method, in order to guarantee that this initializer won't be executed at all if a value is specified in the build. This does mean the initializer cannot refer to this, super or any non-static member. If lombok generates a constructor for you, it'll also initialize this field with the initializer. +

+ The generated field in the builder to represent a field with a @Builder.Default set is called propertyName$value; an additional boolean field called propertyName$set is also generated to track whether it has been set or not. This is an implementation detail; do not write code that interacts with these fields. Instead, invoke the generated builder-setter method if you want to set the property inside a custom method inside the builder.

Various well known annotations about nullity cause null checks to be inserted and will be copied to parameter of the builder's 'setter' method. See Getter/Setter documentation's small print for more information.

-- cgit