RequiredArgsConstructor is not creating constructor with args

Problem: When we are using Lombok with @RequiredArgsConstructor and next error appears:

RequiredArgsConstructor is not creating constructor with args

Solution: include in the args that you want to use in the constructor @NonNull or set them as final.

Explanation: @RequiredArgs only includes in the constructor args with @NonNull or final.

Source: documentation

For more interesting tutorials & guides just check them HERE.

Leave a Reply

Your email address will not be published. Required fields are marked *