From 653eb56883a6be109ee7e767fae920cae70f569d Mon Sep 17 00:00:00 2001
From: Reinier Zwitserloot
+ * Default: true
+ */
+ boolean fluent() default true;
+
+ /**
+ * Normally the builder's 'set' methods are chaining, meaning, they return the builder so that you can chain
+ * calls to set methods. Set this to {@code false} to have these 'set' methods return {@code void} instead.
+ *
+ * Default: true
+ */
+ boolean chain() default true;
}
diff --git a/src/core/lombok/javac/handlers/HandleBuilder.java b/src/core/lombok/javac/handlers/HandleBuilder.java
index aa485b26..6422f5ed 100644
--- a/src/core/lombok/javac/handlers/HandleBuilder.java
+++ b/src/core/lombok/javac/handlers/HandleBuilder.java
@@ -49,16 +49,19 @@ import com.sun.tools.javac.util.Name;
import lombok.AccessLevel;
import lombok.core.AST.Kind;
import lombok.core.AnnotationValues;
+import lombok.core.HandlerPriority;
+import lombok.core.TransformationsUtil;
import lombok.experimental.Builder;
+import lombok.experimental.NonFinal;
import lombok.javac.JavacAnnotationHandler;
import lombok.javac.JavacNode;
import lombok.javac.handlers.HandleConstructor.SkipIfConstructorExists;
-
import static lombok.javac.Javac.*;
import static lombok.core.handlers.HandlerUtil.*;
import static lombok.javac.handlers.JavacHandlerUtil.*;
@ProviderFor(JavacAnnotationHandler.class)
+@HandlerPriority(-1024) //-2^10; to ensure we've picked up @FieldDefault's changes (-2048) but @Value hasn't removed itself yet (-512), so that we can error on presence of it on the builder classes.
public class HandleBuilder extends JavacAnnotationHandler
It is possible to override the final-by-default and private-by-default behaviour using either an explicit access level on a field, or by using the @NonFinal
or @PackagePrivate
annotations.
It is possible to override any default behaviour for any of the 'parts' that make up @Value
by explicitly using that annotation.
-
@Value
was an experimental feature from v0.11.4 to v0.11.9 (as @lombok.experimental.Value
). It has since been moved into the core package. The old annotation is still
around (and is an alias). It will eventually be removed in a future version, though.
+
+ It is not possible to use @FieldDefaults
to 'undo' the private-by-default and final-by-default aspect of fields in the annotated class. Use @NonFinal
and @PackagePrivate
on the fields in the class to override this behaviour.
+
@Builder
@Accessors
@ExtensionMethod