Java Lombok: Omitting one field in @AllArgsConstructor?

user3656823 picture user3656823 · May 20, 2014 · Viewed 50.6k times · Source

If I specify @AllArgsConstructor using Lombok, it will generate a constructor for setting all the declared (not final, not static) fields. Is it possible to omit some field and this leave generated constructor for all other fields?

Answer

Roel Spilker picture Roel Spilker · May 21, 2014

No that is not possible. There is a feature request to create a @SomeArgsConstructor where you can specify a list of involved fields.

Full disclosure: I am one of the core Project Lombok developers.