My guess is that it's not possible (without having delomboked the code). But why don't you just implement the constructor you need? Lombok is meant to make your life easier, and if something won't work with Lombok, just do it the old fashioned way.

@Data
@Builder
@AllArgsConstructor
public class UserInfo { 
    private int id;
    private String nick;
    @Builder.Default
    private boolean isEmailConfirmed = true;
    
    public UserInfo(){
        isEmailConfirmed = true;
    }
}

Console output:

ui: true
ui2: true

Update
As of 01/2021, this bug seems to be fixed in Lombok, at least for generated constructors. Note that there is still a similar issue when you mix Builder.Default and explicit constructors.

Answer from Michael A. Schaffrath on Stack Overflow
🌐
Baeldung
baeldung.com › home › java › lombok builder with default value
Lombok Builder with Default Value | Baeldung
May 11, 2024 - The default values will be present with the builder, making the first test case pass. However, if we work with Lombok prior to version 1.18.2, the no-args constructor won’t get the default values, making the second test case fail.
Top answer
1 of 9
90

My guess is that it's not possible (without having delomboked the code). But why don't you just implement the constructor you need? Lombok is meant to make your life easier, and if something won't work with Lombok, just do it the old fashioned way.

@Data
@Builder
@AllArgsConstructor
public class UserInfo { 
    private int id;
    private String nick;
    @Builder.Default
    private boolean isEmailConfirmed = true;
    
    public UserInfo(){
        isEmailConfirmed = true;
    }
}

Console output:

ui: true
ui2: true

Update
As of 01/2021, this bug seems to be fixed in Lombok, at least for generated constructors. Note that there is still a similar issue when you mix Builder.Default and explicit constructors.

2 of 9
57

Since the @Builder.Default annotation is broken, I wouldn't use it at all. You can, however, use the following approach by moving the @Builder annotation from class level to the custom constructor:

@Data
@NoArgsConstructor
public class UserInfo {
    
    private int id;
    private String nick;
    private boolean isEmailConfirmed = true;

    @Builder
    @SuppressWarnings("unused")
    private UserInfo(int id, String nick, Boolean isEmailConfirmed) {
        this.id = id;
        this.nick = nick;
        this.isEmailConfirmed = Optional.ofNullable(isEmailConfirmed).orElse(this.isEmailConfirmed);
    }
}

This way you ensure:

  • the field isEmailConfirmed is initialized only in one place making the code less error-prone and easier to maintain later
  • the UserInfo class will be initialized the same way either you use a builder or a no-args constructor

In other words, the condition holds true:

new UserInfo().equals(UserInfo.builder().build())

In that case, the object creation is consistent no matter how you create it. It is especially important when your class is used by a mapping framework or by JPA provider when you are not instantiating it manually by a builder but a no-args constructor is invoked behind your back to create the instance.

The approach described above is very similar but it has a major drawback. You have to initialize the field in two places which makes the code error-prone as you are required to keep the values consistent.

Discussions

lombok - Java Record with @Builder.Default - Stack Overflow
I'm wondering is there any way to combine java record with lombok's @Builder.Default? Let's consider an example with properties object for new file creation. Before java 14 @Value @Builder public c... More on stackoverflow.com
🌐 stackoverflow.com
Records and @Builder
It does not defeat the purpose. Records are immutable data objects. How you initialize them, is up to you and using the builder pattern on big data objects makes sense as sometimes the default record constructor might be inflexible. If you don't want to use lombok (@Builder), this works great: https://github.com/Randgalt/record-builder More on reddit.com
🌐 r/javahelp
12
2
September 2, 2024
Spring boot Lombok and Builder, please help a junior
Builder allows you to initialize the variables in your pojo in the same line. Person.builder() .name("Adam Savage") .city("San Francisco") .job("Mythbusters") .job("Unchained Reaction") .build(); More on reddit.com
🌐 r/SpringBoot
14
3
October 14, 2022
builder, optional parameters, mandatory parameters
You could always go with a staged builder approach More on reddit.com
🌐 r/java
19
31
September 4, 2020
🌐
Project Lombok
projectlombok.org › api › lombok › Builder.Default
Builder.Default (Lombok)
The field annotated with @Default must have an initializing expression; that expression is taken as the default to be used if not explicitly set during building.
🌐
Google Groups
groups.google.com › g › project-lombok › c › e9PzKXRlXXA
@Builder.Default and manual constructors
Having @Builder.Default on a field moves its initializer to a separate method, which is later called only of necessary by the builder's build() method. Lately, lombok significantly improved by also using this initializer method for generated @*ArgsConstructors.
🌐
Project Lombok
projectlombok.org › features › Builder
@Builder
If true (which is the default), lombok automatically tries to singularize your identifier name by assuming that it is a common english plural. If false, you must always explicitly specify the singular name, and lombok will generate an error if you don't (useful if you write your code in a language ...
🌐
Medium
bappy0.medium.com › why-lombok-builder-ignores-your-default-field-values-and-how-to-fix-it-5f0123bfd73b
Why Lombok’s @Builder Ignores Your Default Field Values (And How to Fix It) | by Rakib Hasan Bappy | Medium
September 23, 2025 - If you want a default value to be used when the builder property is not set explicitly, annotate the field with @Builder.Default. Without @Builder.Default, fields default to Java’s default values ( null, 0, f, etc.) when not set in the builder.
Find elsewhere
🌐
Java Tutorials
javabydeveloper.com › home › lombok › lombok builder default values examples
Lombok Builder default values Examples
September 28, 2023 - To Setup in Eclipse or in Spring Tool Suite refer to our Lombok Maven example setup with Eclipse. ... If you set any default values to the fields, they never considered during build the object. @ToString @Builder(builderClassName = "Builder") public class LombokBuilderDefaultValueDemo1 { private Long id; private String name = "anonymous"; private boolean active; private int role; private double salary; private int defaultRole = 3; }
🌐
Reinhard
blog.reinhard.codes › 2016 › 07 › 13 › using-lomboks-builder-annotation-with-default-values
Using Lombok's @Builder annotation with default values | reinhard.codes
July 13, 2016 - Update: Lombok v1.16.16 adds a new feature that makes default builder values a bit easier to work with: @Builder.Default.
🌐
Javadoc.io
javadoc.io › doc › org.projectlombok › lombok › 1.18.28 › lombok › Builder.Default.html
Builder.Default - lombok 1.18.28 javadoc
Latest version of org.projectlombok:lombok · https://javadoc.io/doc/org.projectlombok/lombok · Current version 1.18.28 · https://javadoc.io/doc/org.projectlombok/lombok/1.18.28 · package-list path (used for javadoc generation -link option) https://javadoc.io/doc/org.projectlombok/lombok/1.18.28/package-list ·
🌐
Baeldung
baeldung.com › home › java › using lombok’s @builder annotation
Using Lombok's @Builder Annotation | Baeldung
July 25, 2024 - Since Lombok v1.16.16, we can alternatively use the @Builder.Default annotation to set a default value for the field we want to ignore in the builder.
🌐
javathinking
javathinking.com › blog › default-value-in-lombok-how-to-init-default-with-both-constructor-and-builder
Lombok Default Values: How to Initialize with Constructor and Builder (Fix @Builder.Default Issue) — javathinking.com
This is the core of the @Builder.Default issue. Lombok’s @Builder generates a builder that initializes fields to their "zero values" (e.g., null for String, 0 for int) unless explicitly set via the builder.
🌐
Project Lombok
projectlombok.org › features › experimental › SuperBuilder
@SuperBuilder
Example usage where all options are changed from their defaults: @SuperBuilder(buildMethodName = "execute", builderMethodName = "helloWorld", toBuilder = true, setterPrefix = "set") Looking to use your superbuilder with Jackson, the JSON/XML tool? We have you covered: Check out the @Jacksonized feature. lombok.builder.className = [a java identifier with an optional star to indicate where the return type name goes] (default: *Builder)
🌐
javathinking
javathinking.com › blog › lombok-builder-with-default-value
Lombok Builder with Default Values: A Comprehensive Guide — javathinking.com
The @Builder.Default annotation is the most straightforward and recommended approach for most use cases, while field initialization and builder customization offer additional flexibility for complex scenarios.
🌐
Exabyting
exabyting.com › blog › why-lombok-builder-ignores-your-default-field-values-and-how-to-fix-it
Why Lombok @Builder Ignores Your Default Field Values (And How to Fix It) – Exabyting
September 22, 2025 - If you want a default value to be used when the builder property is not set explicitly, annotate the field with @Builder.Default. Without @Builder.Default, fields default to Java’s default values ( null, 0, f, etc.) when not set in the builder.
🌐
iO Flood
ioflood.com › blog › lombok-builder
Lombok @Builder | Streamlining Java Object Creation
March 5, 2024 - Note that we’ve used the @Builder.Default annotation to set a default value for the department field. These advanced techniques can make the Lombok builder pattern even more powerful and flexible, allowing you to write more efficient and readable code. While Lombok’s builder pattern is a powerful tool for reducing boilerplate code, it’s not the only way to implement the builder pattern in Java.
🌐
Project Lombok
projectlombok.org › api › lombok › Builder
Builder (Lombok)
The field annotated with @Default must have an initializing expression; that expression is taken as the default to be used if not explicitly set during building. ... Put on a field (in case of @Builder on a type) or a parameter (for @Builder on a constructor or static method) to indicate how ...
🌐
HowToDoInJava
howtodoinjava.com › home › lombok › lombok @builder
Lombok @Builder with Examples- HowToDoInJava
December 15, 2021 - Internally a class ArticleBuilder and a build() method are auto-generated along with setter like methods for each parameter to the builder class. import java.util.List; import lombok.Builder; import lombok.Getter; import lombok.ToString; @Builder @Getter @ToString public class Article { private Long id; private String title; private List<String> tags; }