- Intellij Preferences > Live Templates > group
Java - Add a new one with
- abbreviation
rnn - Description
requireNonNull - Template text
java.util.Objects.requireNonNull($var$, "$var$ is null") - Applicable contexts:
Java > Expression - check
use static imports if possible - Edit variables button and there add
varvariable withvariableOfType("Object")expression
- abbreviation
Last active
June 25, 2024 17:35
-
-
Save findepi/b597d2bc91e5a30c2a44fd65fe252f0b to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
A little bit more automated way for constructors:
https://stackoverflow.com/questions/54047689/generate-objects-requirenonnull-lines-for-each-argument-automatically-in-intel