Bulk-add {'@'}Data / {'@'}Builder / ... Lombok annotations to a Java class.

Switch tool
Class-level:Options:
Java input
Generated

How to use

Purpose

Lombok code generator. From a Java class field list, auto-generates the matching Lombok annotations (@Data / @Builder / @Getter / @Setter / @AllArgsConstructor / @NoArgsConstructor / @ToString / @EqualsAndHashCode) and shows equivalent original code (getter/setter/equals/hashCode/toString/Builder). Common for learning Lombok, generating Lombok-free equivalent code (when Lombok is banned), code review verification. All generation runs locally.

Steps

  1. Type Java field list on the left (name + type + comment)
  2. Check the Lombok annotations to apply: @Data / @Builder / @Slf4j etc.
  3. Right pane shows the annotated class
  4. Also shows equivalent original code (handwritten getter/setter/equals)
  5. Lombok modes: minimal (@Data only) or explicit (each annotation separate)
  6. Builder: Lombok @Builder or original Builder static inner class
  7. Immutable: @Value (final fields) instead of @Data
  8. Logging annotation: @Slf4j / @Log4j2 / @CommonsLog

FAQ

Why do some projects ban Lombok?
Opponents argue: 1) implicit code (annotation-generated getter/setter/equals invisible); newcomers cannot read; 2) depends on compile-time processor (lombok.jar), build setup complex; 3) IDE compatibility history (early IntelliJ / Eclipse needed plugins, much better now); 4) refactoring difficulty (refactor may miss Lombok-generated methods). Supporters: 1) reduce boilerplate 50-80%; 2) readability (@Data focuses on business fields). In practice 70%+ of mainstream Java projects use Lombok.
@Data vs @Value?
@Data: @Getter + @Setter + @ToString + @EqualsAndHashCode + @RequiredArgsConstructor. Generates a mutable POJO. @Value: @Getter + @AllArgsConstructor + @ToString + @EqualsAndHashCode + final (all fields final, class final). Generates an immutable value object. Use @Data for VO/DTO (might be modified); use @Value for immutable entities (configs, coordinates).
How is equals/hashCode generated?
@EqualsAndHashCode default: uses all non-static, non-transient fields. callSuper = true: includes parent fields (set this when extending, otherwise parent fields excluded). onlyExplicitlyIncluded = true: only fields marked @EqualsAndHashCode.Include (common for JPA Entities to avoid hashCode instability beyond @Id).
IDE does not recognize Lombok annotations?
IntelliJ IDEA: install Lombok Plugin (newer versions bundle it) + enable "Annotation Processing" (Settings → Compiler → Annotation Processors). Eclipse: download lombok.jar, double-click to install into eclipse.ini. VS Code: install "Lombok Annotations Support" extension. Add lombok dependency in pom.xml / build.gradle for all IDEs.
How to use @Builder, especially for nested objects?
Basic: User.builder().name("Tom").age(30).build(). @Builder.Default: default value (without it, builder loses defaults). @Singular: List/Set fields get .tag("x").tag("y") instead of .tags(List.of("x","y")). Nested Builder: each inner object also needs @Builder; call .address(Address.builder()...build()).

Use cases

  • New Java class: define fields, add Lombok annotations in one click
  • Projects without Lombok: generate equivalent original code
  • Learning Lombok: see what @Data expands to
  • Code Review: verify @Builder and complex annotations’ actual output
  • Migration: convert handwritten getter/setter to Lombok

Use cases

New Java class, Lombok-banned projects, Lombok learning, Code Review, legacy migration. Java backend, technical lead, code reviewer. Lombok / equivalent dual display, @Data vs @Value, Builder generation are the differentiators.