Post fix

It works again!

@Builder
public record MyRecord(String myField) {
}

Pre fix

It was a known IntelliJ bug. There was, however, a workaround:

public record MyRecord(String myField) {
    @Builder public MyRecord {}
} 

Important: Once you insert the @builder inside the record, you must remove the @builder above it

Answer from yoni on Stack Overflow
🌐
Medium
brett-fisher.medium.com › java-records-and-lombok-in-practise-37447cd22415
Java Records and Lombok in practise | by Brett Fisher | Medium
September 28, 2021 - See here for code example for constructor based validation using Lombok. See here for code example for constructor based validation using Record. See here for code example for constructor based validation using standard Java Class. The current implementation for Records do not account for building objects fluently, i.e. var vehicle = Vehicle.builder() .id(UUID.randomUUID()) .engine(Engine.builder.build()) .build();
Discussions

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
[BUG] `@Builder` not working as expected with Java records
There was an error while loading. Please reload this page · Meanwhile the class equivalent of the same record works fine: More on github.com
🌐 github.com
1
November 3, 2021
Why Java's Records Are Better* Than Lombok's @Data and Kotlin's Data Classes
Records just seem like a natural evolution of what was already started by making Enums, anyway. Java Enums are one of the best, most underused parts of the language. By being actually objects that can implement interfaces and give immutability guarantees "for free", they really help the expressivity of a design. The whole "single element Enum as SINGLETON" train of thought naturally leads to usage as enumerated STRATEGY/STATE, and feels really nice. More on reddit.com
🌐 r/java
99
141
May 7, 2021
Record Success Stories
What sort of improvements are you expecting? It's just immutable data. More on reddit.com
🌐 r/java
19
18
January 20, 2023
🌐
GitHub
github.com › projectlombok › lombok › issues › 3883
[BUG] @Builder annotation broken with Java records · Issue #3883 · projectlombok/lombok
May 16, 2025 - package org.example; import java.util.List; import lombok.Builder; @Builder public record Example(List<String> list) { }
Author   projectlombok
🌐
Project Lombok
projectlombok.org › features › Builder
@Builder
There is no way to pass an explicit Comparator to use in the builder. An ArrayList is used to store added elements as call methods of a @Singular marked field, if the target collection is from the java.util package, even if the collection is a set or map. Because lombok ensures that generated collections are compacted, a new backing instance of a set or map must be constructed anyway, and storing the data as an ArrayList during the build process is more efficient that storing it as a map or set.
🌐
Baeldung
baeldung.com › home › java › core java › java record vs. lombok
Java Record vs. Lombok | Baeldung
January 16, 2024 - In conclusion, records are better for smaller objects. Though, for objects with many fields, the lack of creational patterns will make Lombok’s @Builder a better option. We can use java records exclusively for immutable data.
Find elsewhere
🌐
Medium
medium.com › @trivajay259 › builder-pattern-for-java-records-f62d884e9973
Builder Pattern for Java Records. The builder pattern aims to provide a… | by Ajay Kumar | Medium
March 12, 2026 - public record Team(String name, String description, String uuid, String photoPath) { public static final class Builder{ String name; String description; String uuid; String photoPath; public Builder uuid(String uuid) { this.uuid = uuid; return this; } public Builder description(String description) { this.description = description; return this; } public Builder name(String name) { this.name = name; return this; } public Builder status(String description) { this.description = description; return this; } public Team build() { return new Team(uuid, name, name, photoPath); } } }
🌐
Coderanch
coderanch.com › t › 776178 › java › Record-Lombok
Record vs Lombok (Java in General forum at Coderanch)
August 21, 2023 - However, you can mix records with some Lombok, e.g. use a record plus Lombok's @Builder annotation: There's also a separate project, RecordBuilder, with similar functionality, without the other parts of Lombok that may make your teammates want to kill you.
🌐
nipafx
nipafx.dev › java-record-semantics
Why Java's Records Are Better* Than Lombok's @Data and Kotlin's Data Classes // nipafx
May 5, 2021 - You can see that the semantic of holding data is there as well, but it's pretty weak and the focus is on deriving functionality, i.e. generating code. Indeed, data classes offer more class building tools than records (mutable "components", hidden state, ...), but unlike with Lombok, you can't use all of them (can't be extended, can't create your own copy method, ...).
🌐
YouTube
youtube.com › watch
Lombok vs. Java Record: A Comparative Analysis - YouTube
Join us in this enlightening YouTube video as we dive deep into the world of Java development. Discover the key distinctions between Lombok and Java Records,...
Published   September 20, 2023
🌐
GitHub
github.com › projectlombok › lombok › issues › 3028
[BUG] `@Builder` not working as expected with Java records · Issue #3028 · projectlombok/lombok
November 3, 2021 - @Builder does not detect and generate methods for the Java record fields. This does not work: @Builder(builderMethodName = "internalBuilder") public record ApiError(String title, Map errors) { public static ApiErrorBuilde...
Author   projectlombok
🌐
Baris
baris.io › blog › java-records-lombok-pojos
Java Records, Lombok and POJOs
November 16, 2021 - Motivation, Goals and Non-Goals are pretty well-defined in these JEPs. record User(String id, String name, String address) { } With this definition, we can create new User instances with the new keyword like a normal class.
🌐
Medium
medium.com › @samuelcatalano › migrating-from-lombok-to-records-in-java-fa2ece28bd68
Migrating From Lombok to Records in Java | by Samuel Catalano | The Fresh Writes | Medium
January 25, 2024 - In the Lombok, the @Builder annotation creates a builder class tailored to the FilmWithLombok class. This builder offers a seamless interface for constructing instances, incorporating optional and chainable setter methods. public record ...
🌐
Medium
medium.com › codex › why-is-lombok-still-in-every-java-developer-toolkit-ba038bf47f7
Why Is Lombok Still in Every Java Developer Toolkit? | by Milos Zivkovic | CodeX | Medium
August 26, 2023 - Why Is Lombok Still in Every Java Developer Toolkit? Why Lombok still holds its respected place amongst experienced Java developers “Why are you using Lombok to generate getters and setters? I …
🌐
LinkedIn
linkedin.com › pulse › java-record-class-act-niranjan-r-ந-ரஞ-சன-இர-
Java Record, “record - a class (at) act”
March 9, 2023 - Alternatively, 3rd party libraries like Lombok supports builder pattern for java record.
🌐
JetBrains
youtrack.jetbrains.com › issue › IDEA-266513 › Problem-with-lombok-@Builder-and-record.
Problem with lombok @Builder and record. : IDEA-266513
{{ (>_<) }} This version of your browser is not supported. Try upgrading to the latest stable version. Something went seriously wrong
🌐
JetBrains
youtrack.jetbrains.com › issue › IDEA-266513 › Problem-with-lombok-Builder-and-record
Jetbrains
May 7, 2022 - {{ (>_<) }} This version of your browser is not supported. Try upgrading to the latest stable version. Something went seriously wrong
🌐
Medium
gaozhixiang.medium.com › records-vs-lombok-in-java-15-193306340ca0
Java 15 Records vs. Lombok. This article shows how to use the new… | by Will | Medium
November 13, 2022 - Java 15 Records vs. Lombok This article shows how to use the new records feature introduced in java15 and compares it with lombok. Let’s start with a simple immutable class which holds a couple of …
🌐
PicoDotDev
picodotdev.github.io › blog-bitix › 2022 › 08 › ejemplo-de-patron-builder-para-las-clases-record-de-java
Ejemplo de patrón Builder para las clases Record de Java
August 12, 2022 - Ambas proporcionan soporte para evitar mucho del código de las clases Java que se suelen utilizar como contenedores de datos, además proporcionan soporte para crear Builders a ...