aboutsummaryrefslogtreecommitdiff
path: root/src/core/lombok/Builder.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/core/lombok/Builder.java')
-rw-r--r--src/core/lombok/Builder.java42
1 files changed, 42 insertions, 0 deletions
diff --git a/src/core/lombok/Builder.java b/src/core/lombok/Builder.java
index a16717cc..7ae43bfa 100644
--- a/src/core/lombok/Builder.java
+++ b/src/core/lombok/Builder.java
@@ -132,6 +132,48 @@ public @interface Builder {
String builderClassName() default "";
/**
+ * Should the generated builder extend the parent class's builder?
+ *
+ * If {@code true}, the generated builder class will extend the builder of the
+ * superclass. This means the builder also contains the methods for fields from
+ * the superclass.
+ * <p>
+ * Note that both this builder and the superclass' builder must be a builder
+ * for a type (so, not for a static method or a constructor). You must mark
+ * the parent extendable: {@code @Builder(extensible = true)}.
+ * <p>
+ * This builder will also be {@code extensible = true} if you set {@code inherit = true}.
+ *
+ * @see #extensible()
+ */
+ boolean inherit() default false;
+
+ /**
+ * Should the generated builder be extensible by subclasses?
+ *
+ * If {@code true} the generated builder class will be extensible by
+ * {@code @Builder} classes of this class's subclasses, by marking them
+ * with {@code @Builder(inherit = true)}.
+ * <p>
+ * The {@code @Builder} extensible system only works for {@code @Builder}
+ * annotations on types (so, not on a static method or a constructor).
+ *
+ * @see #inherit()
+ */
+ boolean extensible() default false;
+
+ /**
+ * Name of the builder class in the superclass.
+ *
+ * Only relevant if {@code inherit = true}
+ *
+ * Default: {@code (SuperclassTypeName)Builder}.
+ *
+ * @see #inherit()
+ */
+ String superclassBuilderClassName() default "";
+
+ /**
* If true, generate an instance method to obtain a builder that is initialized with the values of this instance.
* Legal only if {@code @Builder} is used on a constructor, on the type itself, or on a static method that returns
* an instance of the declaring type.