@Target(TYPE)
@Retention(SOURCE)
public @interface SuperBuilder
@SuperBuilder, but which works well when extending.
It is similar to @Builder, except it is only legal on types, is less configurable, but allows you to extends other builder-able classes.
All classes in the hierarchy must be annotated with @SuperBuilder.
Lombok generates 2 inner 'builder' classes, which extend the parent class' builder class (unless your class doesn't have an extends clause).
Lombok also generates a static method named builder(), and a protected constructor that takes 1 argument of the builderclass type.
The TBuilder class contains 1 method for each parameter of the annotated
constructor / method (each field, when annotating a class), which returns the builder itself.
The builder also has a build() method which returns a completed instance of the original type.
Complete documentation is found at the project lombok features page for @SuperBuilder.
Singular| Modifier and Type | Optional Element | Description |
|---|---|---|
java.lang.String |
builderMethodName |
|
java.lang.String |
buildMethodName |
|
boolean |
toBuilder |
If
true, generate an instance method to obtain a builder that is initialized with the values of this instance. |
java.lang.String builderMethodName
builder.Copyright © 2009-2018 The Project Lombok Authors, licensed under the MIT licence.