aboutsummaryrefslogtreecommitdiff
path: root/website/templates
diff options
context:
space:
mode:
authorReinier Zwitserloot <r.zwitserloot@projectlombok.org>2019-12-11 01:48:16 +0100
committerReinier Zwitserloot <r.zwitserloot@projectlombok.org>2019-12-11 01:48:16 +0100
commit870937a46f912592206abda57638d142ae81e763 (patch)
tree4fc8825569be6ec6430d886906cc52476dad8509 /website/templates
parent35f9a8360e06a628823eae38a82b65b8bf1f5926 (diff)
downloadlombok-870937a46f912592206abda57638d142ae81e763.tar.gz
lombok-870937a46f912592206abda57638d142ae81e763.tar.bz2
lombok-870937a46f912592206abda57638d142ae81e763.zip
[builder] setterPrefix option code review, formatting cleanup, and docs
Diffstat (limited to 'website/templates')
-rw-r--r--website/templates/features/Builder.html6
1 files changed, 5 insertions, 1 deletions
diff --git a/website/templates/features/Builder.html b/website/templates/features/Builder.html
index d22877ea..08ff1ec8 100644
--- a/website/templates/features/Builder.html
+++ b/website/templates/features/Builder.html
@@ -68,10 +68,12 @@
If you want <code>toBuilder()</code> (default: no)
</li><li>
The access level of all generated elements (default: <code>public</code>).
+ </li><li>
+ (discouraged) If you want your builder's 'set' methods to have a prefix, i.e. <code>Person.builder().setName("Jane").build()</code> instead of <code>Person.builder().name("Jane").build()</code> and what it should be.
</li>
</ul>
Example usage where all options are changed from their defaults:<br />
- <code>@Builder(builderClassName = "HelloWorldBuilder", buildMethodName = "execute", builderMethodName = "helloWorld", toBuilder = true, access = AccessLevel.PRIVATE)</code><br />
+ <code>@Builder(builderClassName = "HelloWorldBuilder", buildMethodName = "execute", builderMethodName = "helloWorld", toBuilder = true, access = AccessLevel.PRIVATE, setterPrefix = "set")</code><br />
</p>
</@f.overview>
@@ -132,6 +134,8 @@
If lombok cannot singularize your identifier, or it is ambiguous, lombok will generate an error and force you to explicitly specify the singular name.
</p><p>
The snippet below does not show what lombok generates for a <code>@Singular</code> field/parameter because it is rather complicated. You can view a snippet <a href="builderSingular">here</a>.
+ </p><p>
+ If also using <code>setterPrefix = "with"</code>, the generated names are, for example, <code>withName</code> (add 1 name), <code>withNames</code> (add many names), and <code>clearNames</code> (reset all names).
</p>
</@f.featureSection>