Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docs] Add a note Builder.Default limitation with records #3643

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
8 changes: 8 additions & 0 deletions website/templates/features/Builder.html
Expand Up @@ -103,6 +103,14 @@ <h3 id="builderdefault"><a name="builderdefault">@Builder.Default</a></h3>
<code>@Builder.Default private final long created = System.currentTimeMillis();</code><br/>
Calling Lombok-generated constructors such as <code>@NoArgsConstructor</code> will also make use of the defaults specified using <code>@Builder.Default</code> however explicit constructors will no longer use the default values and will need to be set manually or call a Lombok-generated constructor such as <code>this();</code> to set the defaults.
</p>
<p>
<code>@Builder.Default</code> is not supported with <code>records</code>. Instead, you can customize the builder class to set the default value
</p>
<ol class="snippet example">
<li>public static class PersonBuilder {</li>
<li class="continued">private String city = "San Francisco";</li>
<li>}</li>
</ol>
</@f.featureSection>

<@f.featureSection>
Expand Down