diff options
Diffstat (limited to 'website')
-rw-r--r-- | website/templates/features/With.html | 7 | ||||
-rw-r--r-- | website/templates/features/experimental/index.html | 7 | ||||
-rw-r--r-- | website/templates/features/index.html | 4 | ||||
-rw-r--r-- | website/templates/order-license-info.html | 2 | ||||
-rw-r--r-- | website/templates/setup/javac.html | 4 | ||||
-rw-r--r-- | website/templates/tidelift.html | 2 | ||||
-rw-r--r-- | website/usageExamples/ToStringExample_post.jpage | 2 | ||||
-rw-r--r-- | website/usageExamples/WithExample_post.jpage | 10 | ||||
-rw-r--r-- | website/usageExamples/WithExample_pre.jpage | 2 |
9 files changed, 20 insertions, 20 deletions
diff --git a/website/templates/features/With.html b/website/templates/features/With.html index 35c52dab..425a1640 100644 --- a/website/templates/features/With.html +++ b/website/templates/features/With.html @@ -14,13 +14,14 @@ </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. 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> To put annotations on the generated method, you can use <code>onMethod=@__({@AnnotationsHere})</code>. Be careful though! This is an experimental feature. For more details see the documentation on the <a href="/features/experimental/onX">onX</a> feature. </p><p> javadoc on the field will be copied to generated with methods. Normally, all text is copied, and <code>@param</code> is <em>moved</em> to the with method, whilst <code>@return</code> lines are stripped from the with method's javadoc. Moved means: Deleted from the field's javadoc. It is also possible to define unique text for the with method's javadoc. To do that, you create a 'section' named <code>WITH</code>. A section is a line in your javadoc containing 2 or more dashes, then the text 'WITH', followed by 2 or more dashes, and nothing else on the line. If you use sections, <code>@return</code> and <code>@param</code> stripping / copying for that section is no longer done (move the <code>@param</code> line into the section). - </p><p> - If you have a hierarchical immutable data structure, the <a href="/features/experimental/WithBy"><code>@WithBy</code></a> feature might be more suitable than <code>@With</code> + </p> </@f.overview> <@f.snippets name="With" /> @@ -45,8 +46,6 @@ </p><p> No method is generated if any method already exists with the same name (case insensitive) and same parameter count. For example, <code>withX(int x)</code> will not be generated if there's already a method <code>withX(String... x)</code> even though it is technically possible to make the method. This caveat exists to prevent confusion. If the generation of a method is skipped for this reason, a warning is emitted instead. Varargs count as 0 to N parameters. </p><p> - For <code>boolean</code> fields that start with <code>is</code> immediately followed by a title-case letter, nothing is prefixed to generate the wither name. - </p><p> Various well known annotations about nullity cause null checks to be inserted and will be copied to the parameter. See <a href="/features/GetterSetter">Getter/Setter</a> documentation's small print for more information. </p> </@f.smallPrint> diff --git a/website/templates/features/experimental/index.html b/website/templates/features/experimental/index.html index 112d30c4..960f4b1a 100644 --- a/website/templates/features/experimental/index.html +++ b/website/templates/features/experimental/index.html @@ -48,10 +48,6 @@ Don't lose your composition. </@main.feature> - <@main.feature title="@Wither" href="Wither"> - Immutable 'setters' - methods that create a clone but with one changed field. - </@main.feature> - <@main.feature title="onMethod= / onConstructor= / onParam=" href="onX"> Sup dawg, we heard you like annotations, so we put annotations in your annotations so you can annotate while you're annotating. </@main.feature> @@ -90,6 +86,9 @@ <@main.feature title="@Builder: promoted" href="/features/Builder"> <code>@Builder</code> is a solid base to build APIs on, and has been moved to the main package. </@main.feature> + <@main.feature title="@Wither: renamed to @With, and promoted" href="/features/With"> + Immutable 'setters' - methods that create a clone but with one changed field. + </@main.feature> </div> </div> </div> diff --git a/website/templates/features/index.html b/website/templates/features/index.html index 06b47c0b..9e2f53e8 100644 --- a/website/templates/features/index.html +++ b/website/templates/features/index.html @@ -66,6 +66,10 @@ <code>synchronized</code> done right: Don't expose your locks. </@main.feature> + <@main.feature title="@With" href="With"> + Immutable 'setters' - methods that create a clone but with one changed field. + </@main.feature> + <@main.feature title="@Getter(lazy=true)" href="GetterLazy"> Laziness is a virtue! </@main.feature> diff --git a/website/templates/order-license-info.html b/website/templates/order-license-info.html index f5839c0a..46dafd66 100644 --- a/website/templates/order-license-info.html +++ b/website/templates/order-license-info.html @@ -9,7 +9,7 @@ <p> Tidelift offers professional support of open source tools. When you have a Tidelift subscription, they will help you inventory all the various open source tools and libraries you use, give one central location to check compliance, and a single channel for release notes and security advisories. The bulk of the tidelift subscription fee is redistributed to major open source projects, and Project Lombok is one of those 'lifted' projects. Therefore, your Tidelift subscription helps maintain Project Lombok! </p><p> - We recommend a <a class="tidelift-link-inline" href="https://tidelift.com/subscription/pkg/maven-org-projectlombok-lombok?utm_source=lombok&utm_medium=referral&utm_campaign=orderdonate">Tidelift subscription</a> to any corporation that uses Project Lombok. + We recommend a <a class="tidelift-link-inline" href="https://tidelift.com/subscription/pkg/maven-org-projectlombok-lombok?utm_source=maven-org-projectlombok-lombok&utm_medium=referral&utm_campaign=orderdonate">Tidelift subscription</a> to any corporation that uses Project Lombok. </div> <div class="row text-center"> <h2>Order a professional or enterprise license</h2> diff --git a/website/templates/setup/javac.html b/website/templates/setup/javac.html index 48b0ebcf..96bd8c2b 100644 --- a/website/templates/setup/javac.html +++ b/website/templates/setup/javac.html @@ -11,15 +11,13 @@ <p> Support for JDK9, if you haven't modularized your own projects yet (no <code>module-info.java</code> yet), is included in lombok starting with version 1.16.20. Just use lombok as normal: <code> javac -cp lombok.jar ...</code> </p><p> - Support for JDK9 if you did modularize your own projects (you've written a <code>module-info.java</code> file) is available in the <a href="/download-edge">edge release</a>. To use it: <code>javac -cp lombok.jar -p lombok.jar ...</code><br /> + Support for JDK9 if you did modularize your own projects (you've written a <code>module-info.java</code> file):<br /><code>javac -cp lombok.jar -p lombok.jar ...</code><br /> Note that you will have to add lombok to your <code>module-info.java</code> file:<pre> module <em>myapp</em> { requires static lombok; }</pre> </p><p> The 'static' part ensures that you won't need lombok to be present at runtime. - </p><p> - Feedback about JDK9 module-info support can be given at <a href="https://github.com/rzwitserloot/lombok/issues/985">github issue #985</a>. </p> </@s.section> </@s.scaffold> diff --git a/website/templates/tidelift.html b/website/templates/tidelift.html index 7f0ab88b..3d020d7a 100644 --- a/website/templates/tidelift.html +++ b/website/templates/tidelift.html @@ -14,7 +14,7 @@ </p> </div> <div class="row text-center"> - <a class="tideliftb tideliftb1" href="https://tidelift.com/subscription/pkg/maven-org-projectlombok-lombok?utm_source=lombok&utm_medium=referral&utm_campaign=enterprise">LEARN MORE</a> <a class="tideliftb tideliftb2" href="https://tidelift.com/subscription/request-a-demo?utm_source=lombok&utm_medium=referral&utm_campaign=enterprise">REQUEST A DEMO</a> + <a class="tideliftb tideliftb1" href="https://tidelift.com/subscription/pkg/maven-org-projectlombok-lombok?utm_source=maven-org-projectlombok-lombok&utm_medium=referral&utm_campaign=enterprise">LEARN MORE</a> <a class="tideliftb tideliftb2" href="https://tidelift.com/subscription/request-a-demo?utm_source=maven-org-projectlombok-lombok&utm_medium=referral&utm_campaign=enterprise">REQUEST A DEMO</a> </div> <div class="row text-center"> <h2>The Tidelift Subscription manages your dependencies for you</h2> diff --git a/website/usageExamples/ToStringExample_post.jpage b/website/usageExamples/ToStringExample_post.jpage index 67e78f20..9e41b26b 100644 --- a/website/usageExamples/ToStringExample_post.jpage +++ b/website/usageExamples/ToStringExample_post.jpage @@ -8,7 +8,7 @@ public class ToStringExample { private int id; public String getName() { - return this.getName(); + return this.name; } public static class Square extends Shape { diff --git a/website/usageExamples/WithExample_post.jpage b/website/usageExamples/WithExample_post.jpage index a881ed8d..c19e26e4 100644 --- a/website/usageExamples/WithExample_post.jpage +++ b/website/usageExamples/WithExample_post.jpage @@ -1,8 +1,8 @@ import lombok.NonNull; public class WithExample { - private final int age; private @NonNull final String name; + private final int age; public WithExample(String name, int age) { if (name == null) throw new NullPointerException(); @@ -10,12 +10,12 @@ public class WithExample { this.age = age; } - public WithExample withAge(int age) { - return this.age == age ? this : new WithExample(name, age); - } - protected WithExample withName(@NonNull String name) { if (name == null) throw new java.lang.NullPointerException("name"); return this.name == name ? this : new WithExample(name, age); } + + public WithExample withAge(int age) { + return this.age == age ? this : new WithExample(name, age); + } } diff --git a/website/usageExamples/WithExample_pre.jpage b/website/usageExamples/WithExample_pre.jpage index 3c76204e..2f78020a 100644 --- a/website/usageExamples/WithExample_pre.jpage +++ b/website/usageExamples/WithExample_pre.jpage @@ -3,8 +3,8 @@ import lombok.NonNull; import lombok.With; public class WithExample { - @With private final int age; @With(AccessLevel.PROTECTED) @NonNull private final String name; + @With private final int age; public WithExample(String name, int age) { if (name == null) throw new NullPointerException(); |