aboutsummaryrefslogtreecommitdiff
path: root/website/features
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2015-11-16 23:46:12 +0100
committerReinier Zwitserloot <reinier@zwitserloot.com>2015-11-16 23:46:12 +0100
commitbd78d0841775b1a1c91ed4eef1defc62b33e9ed5 (patch)
tree3be0b0748e95b0e96fea16fe2868d88c0965688d /website/features
parentae4035c9bf117e8f823512c5fd040bd57bc3742e (diff)
downloadlombok-bd78d0841775b1a1c91ed4eef1defc62b33e9ed5.tar.gz
lombok-bd78d0841775b1a1c91ed4eef1defc62b33e9ed5.tar.bz2
lombok-bd78d0841775b1a1c91ed4eef1defc62b33e9ed5.zip
[builder] Added clearX() functionality for `@Singular` annotations for javac. Also docs and changelog.
Diffstat (limited to 'website/features')
-rw-r--r--website/features/Builder.html7
1 files changed, 4 insertions, 3 deletions
diff --git a/website/features/Builder.html b/website/features/Builder.html
index 6cf46600..582be3b4 100644
--- a/website/features/Builder.html
+++ b/website/features/Builder.html
@@ -18,7 +18,8 @@
<code>@Builder</code> was introduced as experimental feature in lombok v0.12.0.
</p><p>
<code>@Builder</code> gained <code>@Singular</code> support and was promoted to the main <code>lombok</code> package since lombok v1.16.0.
- </p>
+ </p><p>
+ <code>@Builder</code> with <code>@Singular</code> adds a clear method since lombok v1.16.8.
</div>
<div class="overview">
<h3>Overview</h3>
@@ -82,11 +83,11 @@
<p>
By annotating one of the parameters (if annotating a static method or constructor with <code>@Builder</code>) or fields (if annotating a class with <code>@Builder</code>) with the
<code>@Singular</code> annotation, lombok will treat that builder node as a collection, and it generates 2 'adder' methods instead of a 'setter' method. One which adds a single element to the collection, and one
- which adds all elements of another collection to the collection. No setter to just set the collection (replacing whatever was already added) will be generated. These 'singular' builders
+ which adds all elements of another collection to the collection. No setter to just set the collection (replacing whatever was already added) will be generated. A 'clear' method is also generated. These 'singular' builders
are very complicated in order to guarantee the following properties:
<ul>
<li>When invoking <code>build()</code>, the produced collection will be immutable.</li>
- <li>Calling one of the 'adder' methods after invoking <code>build()</code> does not modify any already generated objects, and, if <code>build()</code> is later called again, another collection with all the elements added since the creation of the builder is generated.</li>
+ <li>Calling one of the 'adder' methods, or the 'clear' method, after invoking <code>build()</code> does not modify any already generated objects, and, if <code>build()</code> is later called again, another collection with all the elements added since the creation of the builder is generated.</li>
<li>The produced collection will be compacted to the smallest feasible format while remaining efficient.</li>
</ul>
</p><p>