Spring Boot / Part 2YOUTUBE PLAYER LOADS ON PLAYLombok, explained
@Data

Lombok in Spring Boot: Stop Writing Getters and Setters (@Data, @Builder, @Slf4j)

Spring Boot27 Jul 20247:05Open on YouTube

In this lesson

Still writing getters, setters, constructors and loggers by hand? Lombok generates them for you with a single annotation.

  • What Lombok is and how it works
  • Adding Lombok to a Spring Boot project
  • @Data: getters, setters, toString, equals & hashCode in one line
  • @Builder: clean, fluent object creation
  • @Slf4j: a ready-to-use logger with zero setup
  • @With: creating modified copies of immutable objects

Watch next: Java Records, the built-in alternative to Lombok for data classes [Link to your Java Records video]

Keep going

More walkthroughs.