neovim/snippets: Add java negative check

nazuna
Simon Bruder 2023-06-19 18:25:03 +02:00
parent b2636f87fb
commit c85d860c9a
Signed by: simon
GPG Key ID: 8D3C82F9F309F8EC
1 changed files with 4 additions and 0 deletions

View File

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