If I specify @AllArgsConstructor using Lombok, it will generate a constructor for setting all the declared (not final, not static) fields. Is it p
A good way to go around it in some cases would be to use the @Builder
Alternatively, you could use @RequiredArgsConstructor
. This adds a constructor for all fields that are either @NonNull
or final
.
See the documentation
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.