@NonNull annotation in project Lombok

You need to create a file named lombok.config in the home directory of your project, which is the default lombok configuration file to your project. The file looks like:

lombok.nonNull.exceptionType = IllegalArgumentException
lombok.nonNull.flagUsage = [warning | error] 

You may see the project


This is not parameterized in the @NonNull annotation, it can be only specified in the Lombok configuration keys of @NonNull:

Supported configuration keys:

lombok.nonNull.exceptionType = [NullPointerException | IllegalArgumentException | Assertion] (default: NullPointerException).

[...]

Create a lombok.config file in your project root directory, containing this line:

lombok.nonNull.exceptionType = IllegalArgumentException

More details about the Lombok configuration system are in the Lombok documentation page.