mirror of
https://github.com/tiennm99/lombok.git
synced 2026-10-13 06:15:41 +00:00
[fixes #1912] clarifying builder’s behaviour about generating constructors in the face of already present ones.
This commit is contained in:
1 parent
a73965b2b7
commit
dc641cc369
1 file changed
+4
@@ -35,6 +35,10 @@ import java.lang.annotation.Target;
|
||||
* then a private constructor is generated with all fields as arguments
|
||||
* (as if {@code @AllArgsConstructor(AccessLevel.PRIVATE)} is present
|
||||
* on the class), and it is as if this constructor has been annotated with {@code @Builder} instead.
|
||||
* Note that this constructor is only generated if you haven't written any constructors and also haven't
|
||||
* added any explicit {@code @XArgsConstructor} annotations. In those cases, lombok will assume an all-args
|
||||
* constructor is present and generate code that uses it; this means you'd get a compiler error if this
|
||||
* constructor is not present.
|
||||
* <p>
|
||||
* The effect of {@code @Builder} is that an inner class is generated named <code><strong>T</strong>Builder</code>,
|
||||
* with a private constructor. Instances of <code><strong>T</strong>Builder</code> are made with the
|
||||
|
||||
Reference in new issue
Block a user