diff options
Diffstat (limited to 'website/templates/features')
-rw-r--r-- | website/templates/features/Builder.html | 6 | ||||
-rw-r--r-- | website/templates/features/experimental/Tolerate.html | 36 | ||||
-rw-r--r-- | website/templates/features/experimental/index.html | 6 |
3 files changed, 46 insertions, 2 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> diff --git a/website/templates/features/experimental/Tolerate.html b/website/templates/features/experimental/Tolerate.html new file mode 100644 index 00000000..fc0eeb35 --- /dev/null +++ b/website/templates/features/experimental/Tolerate.html @@ -0,0 +1,36 @@ +<#import "../_features.html" as f> + +<@f.scaffold title="@Tolerate" logline="Skip, jump, and forget! Make lombok disregard an existing method or constructor."> + <@f.history> + <p> + <code>@Tolerate</code> was introduced as feature in lombok v1.14.2<br /> + </p> + </@f.history> + + <@f.experimental> + <ul> + <li> + Not used that much. + </li> + <li> + Difficult to support for edge cases, such as recursive delegation. + </li> + </ul> + </@f.experimental> + + <@f.overview> + <p> + Any method or constructor can be annotated with <code>@Tolerate</code> and lombok will act as if it + does not exist. For example, normally lombok would not generate a <code>setDate</code> method for field + named <code>date</code> if you already have a method named <code>setDate</code> in your code already. By + annotating that method with <code>@Tolerate</code>, lombok will generate it anyway. This can be useful if the + type of the parameter of your existing method is different and doesn't clash. + </p> + <p> + Put on any method or constructor to make lombok pretend it doesn't exist, i.e., to generate a method + which would otherwise be skipped due to possible conflicts. + </p> + </@f.overview> + + <@f.snippets name="experimental/Tolerate" /> +</@f.scaffold> diff --git a/website/templates/features/experimental/index.html b/website/templates/features/experimental/index.html index 960f4b1a..b158d381 100644 --- a/website/templates/features/experimental/index.html +++ b/website/templates/features/experimental/index.html @@ -9,7 +9,7 @@ </div> <div class="row"> The <a href="/api/">Lombok javadoc</a> is available, but we advise these pages. - + <p> Experimental features are available in your normal lombok installation, but are not as robustly supported as lombok's main features. In particular, experimental features: <ul> @@ -67,6 +67,10 @@ <@main.feature title="@SuperBuilder" href="SuperBuilder"> Bob now knows his ancestors: Builders with fields from superclasses, too. </@main.feature> + + <@main.feature title="@Tolerate" href="Tolerate"> + Skip, jump, and forget! Make lombok disregard an existing method or constructor. + </@main.feature> </div> <@f.confKeys> |