@NonNull annotation in project Lombok

Viewed 7361

I recently started to use lombok in my project. In lombok documentation, it is specified that @NonNull annotation can be configured to throw either NullPointerException or IllegalArgumentException. It is specified that by default NullPointerException will be thrown. It is also specified that to throw IllegalArgumentException, I should set lombok.nonNull.exceptionType = IllegalArgumentException. But, I am not understanding where I should specify lombok.nonNull.exceptionType = IllegalArgumentException in my code. `

import com.sandesha.lombak.domain.Employee;

import lombok.NonNull;

public class EmployeeOperation {

/**
 * @NonNull performs null check
 * @param e1
 * @param e2
 * @return
 */

public boolean isEqual(@NonNull Employee e1, @NonNull Employee e2)
{
    return e1.equals(e2);
}
}

Please help me. Thank you.

2 Answers
Related