aboutsummaryrefslogtreecommitdiff
path: root/website/features
diff options
context:
space:
mode:
authorReinier Zwitserloot <reinier@zwitserloot.com>2017-03-20 22:54:36 +0100
committerReinier Zwitserloot <reinier@zwitserloot.com>2017-03-20 22:54:36 +0100
commitbf54986e8a08d246877fae902c58dc41ca2f559b (patch)
treef1f05e8d65e35aa0627c69c9fc8ad0d1a69e38b0 /website/features
parentc63c1528843a3ac591c9fbd2db3732af8824d097 (diff)
downloadlombok-bf54986e8a08d246877fae902c58dc41ca2f559b.tar.gz
lombok-bf54986e8a08d246877fae902c58dc41ca2f559b.tar.bz2
lombok-bf54986e8a08d246877fae902c58dc41ca2f559b.zip
Fixing issue #1201: Builder now supports defaults!
Diffstat (limited to 'website/features')
-rw-r--r--website/features/Builder.html11
1 files changed, 10 insertions, 1 deletions
diff --git a/website/features/Builder.html b/website/features/Builder.html
index 22708c8d..20518226 100644
--- a/website/features/Builder.html
+++ b/website/features/Builder.html
@@ -20,6 +20,8 @@
<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>
<code>@Builder</code> with <code>@Singular</code> adds a clear method since lombok v1.16.8.
+ </p><p>
+ <code>@Builder.Default</code> functionality was added in lombok v1.16.16.
</div>
<div class="overview">
<h3>Overview</h3>
@@ -79,7 +81,14 @@
</p>
</div>
<div class="overview">
- <h3><a name="singular">@Singular</a></h3>
+ <h3><a id="builderdefault" name="builderdefault">@Builder.Default</a></h3>
+ <p>
+ To specify a default value, which will be used if, during the build process this value is never set, initialize the field and add the <code>@Builder.Default</code> annotation:<br />
+ <code>@Builder.Default private final long created = System.currentTimeMillis();</code>
+ </p>
+ </div>
+ <div class="overview">
+ <h3><a id="singular" name="singular">@Singular</a></h3>
<p>
By annotating one of the parameters (if annotating a 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