Link Search Menu Expand Document

Lombok is a package that allows the automatic generation of boilerplate code such as getters, setters, toString, hashCode, etc.

Documentation is at

The Maven dependency can be found at:

The most basic use case is to add the following import:

import lombok.Data;

Then, simply make a class with all private attributes, prefixed by the annotation @Data:

import lombok.Data;

public class Foo {
  private int x;
  private double y
  private String name;
  private Bar bar;

Lombok will automatically generate appropriate getters, settters, a toString, a hashCode and equals method, etc.

Table of contents