liveBook · Manning

Lombok

As explained in Spring in Action, Sixth Edition

Lombok is a Java library that generates boilerplate code, such as accessors, constructors, and object methods, through annotations during compilation.

Lombok is a Java library that uses annotations to generate boilerplate during compilation. The @Data annotation supplies getters, setters, equals(), hashCode(), toString(), and a constructor for final properties, keeping domain classes concise. section 2.1.1

Taco domain objects

A concise Ingredient class can declare final id, name, and type fields with @Data, while Taco and TacoOrder use the same annotation for their properties. TacoOrder retains its custom addTaco() method alongside Lombok-generated methods.

How Spring in Action, Sixth Edition covers it

How deep it goes
Explains @Data behavior and Maven setup, including compile-time use and runtime exclusion, without covering Lombok internals.
Examples
Uses Ingredient, Taco, and TacoOrder classes to demonstrate generated methods alongside custom domain behavior.
What it assumes
Assumes basic Java domain classes and Maven project configuration while teaching Lombok setup from its dependency onward.
What you can do after
Apply Lombok with @Data and configure its Maven dependency for compile-time generation.
How it connects
Connects Lombok with Java domain classes, annotations, compilation, Maven, and Spring Boot projects.

Also explained in

Compare how 2 books explain Lombok →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Spring in Action, Sixth Edition. The section links point to the parts of the book it draws on.