From 870937a46f912592206abda57638d142ae81e763 Mon Sep 17 00:00:00 2001 From: Reinier Zwitserloot Date: Wed, 11 Dec 2019 01:48:16 +0100 Subject: [builder] setterPrefix option code review, formatting cleanup, and docs --- website/templates/features/Builder.html | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'website/templates/features/Builder.html') 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 toBuilder() (default: no)
  • The access level of all generated elements (default: public). +
  • + (discouraged) If you want your builder's 'set' methods to have a prefix, i.e. Person.builder().setName("Jane").build() instead of Person.builder().name("Jane").build() and what it should be.
  • Example usage where all options are changed from their defaults:
    - @Builder(builderClassName = "HelloWorldBuilder", buildMethodName = "execute", builderMethodName = "helloWorld", toBuilder = true, access = AccessLevel.PRIVATE)
    + @Builder(builderClassName = "HelloWorldBuilder", buildMethodName = "execute", builderMethodName = "helloWorld", toBuilder = true, access = AccessLevel.PRIVATE, setterPrefix = "set")

    @@ -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.

    The snippet below does not show what lombok generates for a @Singular field/parameter because it is rather complicated. You can view a snippet here. +

    + If also using setterPrefix = "with", the generated names are, for example, withName (add 1 name), withNames (add many names), and clearNames (reset all names).

    -- cgit