aboutsummaryrefslogtreecommitdiff
path: root/website
diff options
context:
space:
mode:
Diffstat (limited to 'website')
-rw-r--r--website/resources/css/custom.css7
-rw-r--r--website/templates/features/Builder.html9
-rw-r--r--website/templates/features/NonNull.html6
-rw-r--r--website/templates/features/configuration.html2
-rw-r--r--website/templates/features/var.html2
5 files changed, 21 insertions, 5 deletions
diff --git a/website/resources/css/custom.css b/website/resources/css/custom.css
index 2815fd21..6774a7d5 100644
--- a/website/resources/css/custom.css
+++ b/website/resources/css/custom.css
@@ -1,3 +1,10 @@
+.importantNotification {
+ background-color: #FFEBCD;
+ border-radius: 20px;
+ padding: 10px;
+ margin: 10px;
+}
+
#clickForVideo {
padding: 20px 30px;
background-color: #DDD;
diff --git a/website/templates/features/Builder.html b/website/templates/features/Builder.html
index 082b97ed..0818f9d2 100644
--- a/website/templates/features/Builder.html
+++ b/website/templates/features/Builder.html
@@ -10,6 +10,8 @@
<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.
+ </p><p>
+ <code>@Builder(builderMethodName = "")</code> is legal (and will suppress generation of the builder method) starting with lombok v1.18.8.
</p>
</@f.history>
@@ -184,6 +186,13 @@ public class JacksonExample {
</p><p>
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 <a href="/features/GetterSetter">Getter/Setter</a> documentation's small print for more information.
</p><p>
+ You can suppress the generation of the <code>builder()</code> method, for example because you <em>just</em> want the <code>toBuilder()</code> functionality, by using:
+ <code>@Builder(builderMethodName = "")</code>. Any warnings about missing <code>@Builder.Default</code> annotations will disappear when you do this, as such warnings
+ are not relevant when only using <code>toBuilder()</code> to make builder instances.
+ </p><p>
+ You can use <code>@Builder</code> for copy constructors: <code>foo.toBuilder().build()</code> makes a shallow clone. Consider suppressing the generating of the
+ <code>builder</code> method if you just want this functionality, by using: <code>@Builder(toBuilder = true, builderMethodName = "")</code>.
+ </p><p>
Due to a peculiar way javac processes static imports, trying to do a non-star static import of the static <code>builder()</code> method won't work. Either use a star static import: `import static TypeThatHasABuilder.*;` or don't statically import the <code>builder</code> method.
</p>
</@f.smallPrint>
diff --git a/website/templates/features/NonNull.html b/website/templates/features/NonNull.html
index 66ab2fc2..e01a3088 100644
--- a/website/templates/features/NonNull.html
+++ b/website/templates/features/NonNull.html
@@ -21,9 +21,9 @@
<@f.confKeys>
<dt>
- <code>lombok.nonNull.exceptionType</code> = [<code>NullPointerException</code> | <code>IllegalArgumentException</code>] (default: <code>NullPointerException</code>).
+ <code>lombok.nonNull.exceptionType</code> = [<code>NullPointerException</code> | <code>IllegalArgumentException</code> | <code>Assertion</code>] (default: <code>NullPointerException</code>).
</dt><dd>
- When lombok generates a null-check <code>if</code> statement, by default, a <code>java.lang.NullPointerException</code> will be thrown with '<em>field name</em> is marked @NonNull but is null' as the exception message. However, you can use <code>IllegalArgumentException</code> in this configuration key to have lombok throw that exception with this message instead.
+ When lombok generates a null-check <code>if</code> statement, by default, a <code>java.lang.NullPointerException</code> will be thrown with '<em>field name</em> is marked non-null but is null' as the exception message. However, you can use <code>IllegalArgumentException</code> in this configuration key to have lombok throw that exception with this message instead. By using <code>Assertion</code>, an <code>assert</code> statement with the same message will be generated.
</dd><dt>
<code>lombok.nonNull.flagUsage</code> = [<code>warning</code> | <code>error</code>] (default: not set)
</dt><dd>
@@ -33,7 +33,7 @@
<@f.smallPrint>
<p>
- Lombok's detection scheme for already existing null-checks consists of scanning for if statements that look just like lombok's own. Any 'throws' statement as the 'then' part of the if statement, whether in braces or not, counts. The conditional of the if statement <em>must</em> look exactly like <code>PARAMNAME == null</code>. The first statement in your method that is not such a null-check stops the process of inspecting for null-checks.
+ Lombok's detection scheme for already existing null-checks consists of scanning for if statements or assert statements that look just like lombok's own. Any 'throws' statement as the 'then' part of the if statement, whether in braces or not, counts. The conditional of the if statement <em>must</em> look exactly like <code>PARAMNAME == null</code>; the assert statement <em>must</em> look exactly like <code>PARAMNAME != null</code>. The first statement in your method that is not such a null-check stops the process of inspecting for null-checks.
</p><p>
While <code>@Data</code> and other method-generating lombok annotations will trigger on various well-known annotations that signify the field must never be <code>@NonNull</code>, this feature only triggers on lombok's own <code>@NonNull</code> annotation from the <code>lombok</code> package.
</p><p>
diff --git a/website/templates/features/configuration.html b/website/templates/features/configuration.html
index 09cd46c2..7a15f252 100644
--- a/website/templates/features/configuration.html
+++ b/website/templates/features/configuration.html
@@ -84,7 +84,7 @@
<code>lombok.addJavaxGeneratedAnnotation = true</code>
</div>
We advise against this; JDK9 breaks this annotation, and it's unlikely to ever get fixed.<br />
- <em>NB:</em> Until Lombok v2.0.0, this setting defaulted to <code>true</code>.
+ <em>NB:</em> Until Lombok v1.16.20, this setting defaulted to <code>true</code>.
</p><p>
Lombok can be configured to add <code>@lombok.Generated</code> annotations to all generated nodes where possible; useful for JaCoCo (which has built in support),
or other style checkers and code coverage tools:
diff --git a/website/templates/features/var.html b/website/templates/features/var.html
index 60e24914..bf28752f 100644
--- a/website/templates/features/var.html
+++ b/website/templates/features/var.html
@@ -3,7 +3,7 @@
<@f.scaffold title="var" logline="Mutably! Hassle-free local variables.">
<@f.history>
<p><ul>
- <li><code>var</code> was promoted to the main package in lombok 2.0.0; given that <a href="http://openjdk.java.net/jeps/286">JEP 286</a> establishes expectations, and lombok's take on <code>var</code> follows these, we've decided to promote <code>var</code> eventhough the feature remains controversial.</li>
+ <li><code>var</code> was promoted to the main package in lombok 1.16.20; given that <a href="http://openjdk.java.net/jeps/286">JEP 286</a> establishes expectations, and lombok's take on <code>var</code> follows these, we've decided to promote <code>var</code> eventhough the feature remains controversial.</li>
<li><code>var</code> was introduced in lombok 1.16.12 as experimental feature.</li>
</ul></p>
</@f.history>