From ad4c612303201665e2362909fa9bd686847f78ba Mon Sep 17 00:00:00 2001 From: Jan Rieke Date: Mon, 10 Feb 2020 12:54:04 +0100 Subject: SuperBuilder setterPrefix documentation --- website/templates/features/experimental/SuperBuilder.html | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'website/templates/features') diff --git a/website/templates/features/experimental/SuperBuilder.html b/website/templates/features/experimental/SuperBuilder.html index 5676b60c..0fa81073 100644 --- a/website/templates/features/experimental/SuperBuilder.html +++ b/website/templates/features/experimental/SuperBuilder.html @@ -32,7 +32,7 @@

To ensure type-safety, @SuperBuilder generates two inner builder classes for each annotated class, one abstract and one concrete class named FoobarBuilder and FoobarBuilderImpl (where Foobar is the name of the annotated class).

- Customizing the code generated by @SuperBuilder is limited to adding new methods or annotations to the builder classes, and providing custom implementations of builder() and build(). + Customizing the code generated by @SuperBuilder is limited to adding new methods or annotations to the builder classes, and providing custom implementations of the 'set', builder(), and build() methods. You have to make sure that the builder class declaration headers match those that would have been generated by lombok. Due to the heavy generics usage, we strongly advice to copy the builder class definition header from the uncustomized delomboked code.

The configurable aspects of builder are: @@ -43,10 +43,12 @@ The builder() method's name (default: "builder")

  • If you want toBuilder() (default: no) +
  • + (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:
    - @SuperBuilder(buildMethodName = "execute", builderMethodName = "helloWorld", toBuilder = true)
    + @SuperBuilder(buildMethodName = "execute", builderMethodName = "helloWorld", toBuilder = true, setterPrefix = "set")

    -- cgit