neovim/snippets: Add java negative check

This commit is contained in:
Simon Bruder 2023-06-19 18:25:03 +02:00
parent b2636f87fb
commit c85d860c9a
Signed by: simon
GPG key ID: 8D3C82F9F309F8EC

View file

@ -73,6 +73,10 @@ let
if (''${1:var} == null) { if (''${1:var} == null) {
throw new NullPointerException("$1 cant be null"); throw new NullPointerException("$1 cant be null");
}$0''; }$0'';
CheckNegative = mkSnippet "chkneg" "Check for negative numbers" ''
if (''${1:var} < 0) {
throw new IllegalArgumentException("$1 cant be negative");
}$0'';
}; };
}; };