You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on May 28, 2022. It is now read-only.
A typical check for null in argument would be as follow:
We can use Java's
Objects#requireNonNull(T)helper method instead. It automatically throws aNullPointerExceptionfor us.For setters and constructors, we can also "inline" this check, by doing this:
Note that this is only allowed if it is a direct assignment, otherwise, never inline it.