diff options
author | Jan Rieke <rieke@subshell.com> | 2017-03-13 14:32:57 +0100 |
---|---|---|
committer | Jan Rieke <rieke@subshell.com> | 2017-03-13 14:37:26 +0100 |
commit | bd51fa8484fde587eef10fc58e4527f26ec16430 (patch) | |
tree | b5a4d7662347aaac311ac693f823d8da33a4f0bf /src/core/lombok/Builder.java | |
parent | 4ec2e5135c373242dd00151eedf40997b0d75fe7 (diff) | |
download | lombok-bd51fa8484fde587eef10fc58e4527f26ec16430.tar.gz lombok-bd51fa8484fde587eef10fc58e4527f26ec16430.tar.bz2 lombok-bd51fa8484fde587eef10fc58e4527f26ec16430.zip |
activate extendable builders explicitly (ensure backwards compatibility)
Diffstat (limited to 'src/core/lombok/Builder.java')
-rw-r--r-- | src/core/lombok/Builder.java | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/core/lombok/Builder.java b/src/core/lombok/Builder.java index 855e96e8..9cf82191 100644 --- a/src/core/lombok/Builder.java +++ b/src/core/lombok/Builder.java @@ -123,15 +123,30 @@ public @interface Builder { String builderClassName() default ""; /** - * If true, the generated builder class will extend the builder of the + * If true, the generated builder class will extend the {@code @Builder} of the * superclass. In this way, the builder will also contain methods for fields - * from the superclass. Note that both this builder and the superclass' - * builder must be a type {@code @Builder}; this feature does neither work - * for constructor nor method {@code @Builder}s. + * from the superclass.<br> + * Note that both this builder and the superclass' builder must be a type + * {@code @Builder}; this feature does neither work for constructor nor + * method {@code @Builder}s. The parent {@code @Builder} must be + * {@link #extendable()}. <br> + * Implies {@link #extendable()}. */ boolean inherit() default false; /** + * If true, the generated builder pattern will be extendable by + * {@code @Builder}s of subclasses, using the {@link #inherit()} feature. + * This is achieved by generating a special constructor that takes a builder + * instance as parameter (instead of an {@link AllArgsConstructor}). <br> + * Note that this builder must be a type {@code @Builder}; this feature does + * neither work for constructor nor method {@code @Builder}s.<br> + * If {@link #inherit()} {@code == true}, {@link #extendable()} will + * automatically be {@code true}. + */ + boolean extendable() default false; + + /** * Name of the builder class in the superclass. Only relevant if * {@code inherit = true} (see {@link #inherit()}). * |