From fdcbaa033d27b344adfea99d8d7bdd99cceacfb3 Mon Sep 17 00:00:00 2001 From: Rawi01 Date: Tue, 2 Feb 2021 09:44:36 +0100 Subject: Replace val with native final var in Java >= 10 --- website/templates/features/val.html | 3 +++ 1 file changed, 3 insertions(+) (limited to 'website') diff --git a/website/templates/features/val.html b/website/templates/features/val.html index 32a8ffdf..1b137c65 100644 --- a/website/templates/features/val.html +++ b/website/templates/features/val.html @@ -5,6 +5,9 @@

val was introduced in lombok 0.10.

+

+ NEW in Lombok 1.18.22: val gets replaced with final var. +

<@f.overview>

-- cgit From 13d84b129e562fdc71b049778c3b3bd2376e29a4 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Mon, 18 Oct 2021 16:01:01 +0200 Subject: [#2693] Docs and changelog for the ‘accessors.capitalization = beanspec’ feature. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- doc/changelog.markdown | 2 +- website/templates/features/GetterSetter.html | 5 +++++ website/templates/features/With.html | 9 +++++++++ website/templates/features/experimental/Accessors.html | 12 +++++++++--- 4 files changed, 24 insertions(+), 4 deletions(-) (limited to 'website') diff --git a/doc/changelog.markdown b/doc/changelog.markdown index 6f9adbac..cd8a4353 100644 --- a/doc/changelog.markdown +++ b/doc/changelog.markdown @@ -2,7 +2,7 @@ Lombok Changelog ---------------- ### v1.18.24 "Edgy Guinea Pig" -* No new changes since the release of v1.18.22. +* FEATURE: Turning a field named `uShape` into a getter is tricky: `getUShape` or `getuShape`? The community is split on which style to use. Lombok does `getUShape`, but if you prefer the `getuShape` style, add to `lombok.config`: `lombok.accessors.capitalization = beanspec`. [Issue #2693](https://github.com/projectlombok/lombok/issues/2693) [Pull Request #2996](https://github.com/projectlombok/lombok/pull/2996). Thanks __@YonathanSherwin__! ### v1.18.22 (October 6th, 2021) * PLATFORM: JDK17 support added. [Issue #2898](https://github.com/projectlombok/lombok/issues/2898). diff --git a/website/templates/features/GetterSetter.html b/website/templates/features/GetterSetter.html index a429c9ac..8b16d34d 100644 --- a/website/templates/features/GetterSetter.html +++ b/website/templates/features/GetterSetter.html @@ -37,6 +37,11 @@ lombok.getter.noIsPrefix = [true | false] (default: false)

If set to true, getters generated for boolean fields will use the get prefix instead of the defaultis prefix, and any generated code that calls getters, such as @ToString, will also use get instead of is +
+ lombok.accessors.capitalization = [basic | beanspec] (default: basic) +
+ Controls how tricky cases like uShaped (one lowercase letter followed by an upper/titlecase letter) are capitalized. basic capitalizes that to getUShaped, and beanspec capitalizes that to getuShaped instead.
+ Both strategies are commonly used in the java ecosystem, though beanspec is more common.
lombok.setter.flagUsage = [warning | error] (default: not set)
diff --git a/website/templates/features/With.html b/website/templates/features/With.html index 8b34f038..867c17eb 100644 --- a/website/templates/features/With.html +++ b/website/templates/features/With.html @@ -27,6 +27,15 @@ <@f.snippets name="With" /> <@f.confKeys> + <>
+ lombok.accessors.prefix += a field prefix (default: empty list) +
+ This is a list property; entries can be added with the += operator. Inherited prefixes from parent config files can be removed with the -= operator. Lombok will strip any matching field prefix from the name of a field in order to determine the name of the getter/setter to generate. For example, if m is one of the prefixes listed in this setting, then a field named mFoobar will result in a getter named getFoobar(), not getMFoobar(). An explicitly configured prefix parameter of an @Accessors annotation takes precedence over this setting. +
+ lombok.accessors.capitalization = [basic | beanspec] (default: basic) +
+ Controls how tricky cases like uShaped (one lowercase letter followed by an upper/titlecase letter) are capitalized. basic capitalizes that to withUShaped, and beanspec capitalizes that to withuShaped instead.
+ Both strategies are commonly used in the java ecosystem, though beanspec is more common.
lombok.with.flagUsage = [warning | error] (default: not set)
diff --git a/website/templates/features/experimental/Accessors.html b/website/templates/features/experimental/Accessors.html index 564ab66d..9a9385cb 100644 --- a/website/templates/features/experimental/Accessors.html +++ b/website/templates/features/experimental/Accessors.html @@ -4,9 +4,11 @@ <@f.history>

@Accessors was introduced as experimental feature in lombok v0.11.0. +

+ The lombok.config option lombok.accessors.capitalization = [basic | beanspec] was added in lombok v1.18.24.

- + <@f.experimental> Current status: neutral - Some changes are expected. These changes are intended to be backwards compatible, but should start in an experimental feature: @@ -44,7 +45,7 @@

- The @Accessors annotation is legal on types and fields; the annotation that applies is the one on the field if present, otherwise the one on the class. When a @Accessors annotation on a field is present, any @Accessors annotation also present on the class the field is in, is entirely ignored, even for properties not configured on the field @Accessors. This in contrast to any lombok.config configuration keys which serve as fall-back default if any explicit @Accessors annotation doesn't specify. + The @Accessors annotation is legal on types and fields; the annotation that applies is the one on the field if present, otherwise the one on the class. When an @Accessors annotation on a field is present, any @Accessors annotation also present on the class the field is in, is entirely ignored, even for properties not configured on the field @Accessors. This in contrast to any lombok.config configuration keys which serve as fall-back default if any explicit @Accessors annotation doesn't specify.

@@ -63,6 +64,11 @@ lombok.accessors.prefix += a field prefix (default: empty list)
This is a list property; entries can be added with the += operator. Inherited prefixes from parent config files can be removed with the -= operator. Any class that either doesn't have an @Accessors annotation, or it does, but that annotation does not have an explicit value for the prefix parameter, will act as if @Accessors(prefix = {prefixes listed in configuration}) is present. +
+ lombok.accessors.capitalization = [basic | beanspec] (default: basic) +
+ Controls how tricky cases like uShaped (one lowercase letter followed by an upper/titlecase letter) are capitalized. basic capitalizes that to getUShaped, and beanspec capitalizes that to getuShaped instead.
+ Both strategies are commonly used in the java ecosystem, though beanspec is more common.
lombok.accessors.flagUsage = [warning | error] (default: not set)
-- cgit From f6e897e486b76548d76a8b16f90516e0cab42985 Mon Sep 17 00:00:00 2001 From: Fatima Rami Date: Sat, 23 Oct 2021 21:49:42 +0200 Subject: [Fixes#3008] @Witer replaced by @With --- website/templates/features/Value.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'website') diff --git a/website/templates/features/Value.html b/website/templates/features/Value.html index c41b6b10..e128383f 100644 --- a/website/templates/features/Value.html +++ b/website/templates/features/Value.html @@ -5,7 +5,7 @@

@Value was introduced as experimental feature in lombok v0.11.4.

- @Value no longer implies @Wither since lombok v0.11.8. + @Value no longer implies @With since lombok v0.11.8.

@Value promoted to the main lombok package since lombok v0.12.0.

-- cgit From 3565bc836e7e6e10a2ec9c3f35f42102b9ba55bf Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Sat, 23 Oct 2021 21:54:53 +0200 Subject: [fixes #3008] [docs] The docs for `@Value` were still referring to `@Wither` instead of `@With` --- website/templates/features/Value.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'website') diff --git a/website/templates/features/Value.html b/website/templates/features/Value.html index c41b6b10..e128383f 100644 --- a/website/templates/features/Value.html +++ b/website/templates/features/Value.html @@ -5,7 +5,7 @@

@Value was introduced as experimental feature in lombok v0.11.4.

- @Value no longer implies @Wither since lombok v0.11.8. + @Value no longer implies @With since lombok v0.11.8.

@Value promoted to the main lombok package since lombok v0.12.0.

-- cgit From 7c8ba501deea24694e2502747b63aa6dab503c79 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Sat, 23 Oct 2021 21:57:06 +0200 Subject: [fixes #3008] [docs] ... and of course the usage example also mentioned `@Wither`. --- website/usageExamples/ValueExample_pre.jpage | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'website') diff --git a/website/usageExamples/ValueExample_pre.jpage b/website/usageExamples/ValueExample_pre.jpage index d9550c25..27b28eb7 100644 --- a/website/usageExamples/ValueExample_pre.jpage +++ b/website/usageExamples/ValueExample_pre.jpage @@ -1,12 +1,12 @@ import lombok.AccessLevel; import lombok.experimental.NonFinal; import lombok.experimental.Value; -import lombok.experimental.Wither; +import lombok.experimental.With; import lombok.ToString; @Value public class ValueExample { String name; - @Wither(AccessLevel.PACKAGE) @NonFinal int age; + @With(AccessLevel.PACKAGE) @NonFinal int age; double score; protected String[] tags; -- cgit From 746ce5d4eece628b1d66a4c60b3bae422f8d0034 Mon Sep 17 00:00:00 2001 From: Fatima Rami Date: Sat, 23 Oct 2021 22:07:52 +0200 Subject: #1990 fixed error documentation @FieldNameConstants --- website/templates/features/experimental/FieldNameConstants.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'website') diff --git a/website/templates/features/experimental/FieldNameConstants.html b/website/templates/features/experimental/FieldNameConstants.html index e88b7670..06fa23b5 100644 --- a/website/templates/features/experimental/FieldNameConstants.html +++ b/website/templates/features/experimental/FieldNameConstants.html @@ -24,7 +24,7 @@

The @FieldNameConstants annotation generates an inner type which contains 1 constant for each field in your class; either string constants (fields marked public static final, of type java.lang.String) or if you prefer, an enum type with 1 value for each field - write @FieldNameConstants(asEnum = true) for the enum variant. @FieldNameConstants is useful for various marshalling and serialization frameworks. The constant field (whether enum value or string constant) always has the exact same name as the field, capitalization and all, unless you set the lombok.fieldNameConstants.uppercase = true option in your lombok.config file; in that case lombok will try to UPPER_CASE the name.

- The generated inner type is by default called Fields and is public. You can modify this via @FieldNameConstants(innerTypeName = "FieldNames", access = AccessLevel.PACKAGE) for example. The default inner type name can also be modified via configuration key lombok.fieldNameConstants.innerTypeName. The generated fields are always public. + The generated inner type is by default called Fields and is public. You can modify this via @FieldNameConstants(innerTypeName = "FieldNames", level = AccessLevel.PACKAGE) for example. The default inner type name can also be modified via configuration key lombok.fieldNameConstants.innerTypeName. The generated fields are always public.

Must be applied to classes (or enums, though you'd rarely want to do that). By default includes all non-transient, non-static fields. You can use @FieldNameConstants.Include in fields + @FieldNameConstants(onlyExplicitlyIncluded = true), or @FieldNameConstants.Exclude for more fine-grained control.

-- cgit