diff options
author | Reinier Zwitserloot <reinier@zwitserloot.com> | 2019-10-02 00:31:26 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-02 00:31:26 +0200 |
commit | 04f21a249dd2f582a27c16da67aebc4df3d2c383 (patch) | |
tree | ac6d1b5f3c68441f78f7e823d64606f6105341bb /website/templates | |
parent | 650e03705edda0788a91c89c34cc6695f4358665 (diff) | |
parent | 3369e0ffc73a8150f58d74c0e44ef59a9e160976 (diff) | |
download | lombok-04f21a249dd2f582a27c16da67aebc4df3d2c383.tar.gz lombok-04f21a249dd2f582a27c16da67aebc4df3d2c383.tar.bz2 lombok-04f21a249dd2f582a27c16da67aebc4df3d2c383.zip |
Merge pull request #2245 from jyterencekim/patch-1
Update With.html
Diffstat (limited to 'website/templates')
-rw-r--r-- | website/templates/features/With.html | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/website/templates/features/With.html b/website/templates/features/With.html index f1719e19..425a1640 100644 --- a/website/templates/features/With.html +++ b/website/templates/features/With.html @@ -14,7 +14,7 @@ </p><p> For example, if you create <code>public class Point { private final int x, y; }</code>, setters make no sense because the fields are final. <code>@With</code> can generate a <code>withX(int newXValue)</code> method for you which will return a new point with the supplied value for <code>x</code> and the same value for <code>y</code>. </p><p> - The <code>@With</code> relies on a constructor for all fields in order to do its work. If this constructor does not exist, your <code>@With</code> annotation will result in a compile time error message. Lombok's own <a href="/features/constructor"><code>@AllArgsConstructor</code></a>. As <a href="/features/Value"><code>Value</code></a> will automatically produce an all args constructor as well, you can use that too. It's of course also acceptable if you manually write this constructor. It must contain all non-static fields, in the same lexical order. + The <code>@With</code> relies on a constructor for all fields in order to do its work. If this constructor does not exist, your <code>@With</code> annotation will result in a compile time error message. You can use Lombok's own <a href="/features/constructor"><code>@AllArgsConstructor</code></a>, or as <a href="/features/Value"><code>Value</code></a> will automatically produce an all args constructor as well, you can use that too. It's of course also acceptable if you manually write this constructor. It must contain all non-static fields, in the same lexical order. </p><p> Like <a href="/features/GetterSetter"><code>@Setter</code></a>, you can specify an access level in case you want the generated with method to be something other than <code>public</code>:<br /> <code>@With(level = AccessLevel.PROTECTED)</code>. Also like <a href="/features/GetterSetter"><code>@Setter</code></a>, you can also put a <code>@With</code> annotation on a type, which means a <code>with</code> method is generated for each field (even non-final fields). </p><p> |