IntelliJ idea——》自動生成notnull判斷
阿新 • • 發佈:2018-12-20
版權宣告:本文為博主原創文章,無需授權即可轉載,甚至無需保留以上版權宣告,轉載時請務必註明作者。
https://blog.csdn.net/weixin_43453386/article/details/84941537
IntelliJ idea——》自動生成notnull判斷
1、判斷jsonStr不為空notnull
public class T {
public static void main(String[] args) {
String jsonStr = "{\"name\":\"哥哥\",\"age\":12}";
}
}
2、在jsonStr.後面輸入notnull,並回車
3、回車後的結果
public class T {
public static void main(String[] args) {
String jsonStr = "{\"name\":\"哥哥\",\"age\":12}";
if (jsonStr != null) {
//TODO
}
}
}