aboutsummaryrefslogtreecommitdiff
path: root/website/templates/features/Builder.html
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2018-07-03 05:40:52 +0200
committerReinier Zwitserloot <reinier@zwitserloot.com>2018-07-03 05:42:34 +0200
commit37434ba0cba68ea232efea0824d3f71e5e287dc2 (patch)
tree02065821a76f358217f29db0555490ddb6431567 /website/templates/features/Builder.html
parentb3771e86f924f97983748511546cb94a2d1f116d (diff)
downloadlombok-37434ba0cba68ea232efea0824d3f71e5e287dc2.tar.gz
lombok-37434ba0cba68ea232efea0824d3f71e5e287dc2.tar.bz2
lombok-37434ba0cba68ea232efea0824d3f71e5e287dc2.zip
[Fixes #1347] issues with no-args constructor and Builder.Default now documented and fixed.
Diffstat (limited to 'website/templates/features/Builder.html')
-rw-r--r--website/templates/features/Builder.html2
1 files changed, 2 insertions, 0 deletions
diff --git a/website/templates/features/Builder.html b/website/templates/features/Builder.html
index 96a30d99..4693d222 100644
--- a/website/templates/features/Builder.html
+++ b/website/templates/features/Builder.html
@@ -158,6 +158,8 @@
An <code>ArrayList</code> is used to store added elements as call methods of a <code>@Singular</code> marked field, if the target collection is from the <code>java.util</code> package, <em>even if the collection is a set or map</em>. Because lombok ensures that generated collections are compacted, a new backing instance of a set or map must be constructed anyway, and storing the data as an <code>ArrayList</code> during the build process is more efficient that storing it as a map or set. This behaviour is not externally visible, an implementation detail of the current implementation of the <code>java.util</code> recipes for <code>@Singular @Builder</code>.
</p><p>
With <code>toBuilder = true</code> applied to methods, any type parameter of the annotated method itself must also show up in the return type.
+ </p><p>
+ The initializer on a <code>@Builder.Default</code> 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 <code>this</code>, <code>super</code> or any non-static member. If lombok generates a constructor for you, it'll also initialize this field with the initializer.
</p>
</@f.smallPrint>
</@f.scaffold>