How to compare null value from the JsonObject in java

前端 未结 7 891
灰色年华
灰色年华 2020-12-30 23:15

stackoverflow member i need some help from you.

I am having a JsonObject given below

{
\"Id\": null,
\"Name\": \"New Task\",
\"StartDate\": \"2010-03         


        
7条回答
  •  傲寒
    傲寒 (楼主)
    2020-12-30 23:19

    For com.google.gson.JsonObject, I followed this :

    boolean isIdNull = jsonObject.get("Id").isJsonNull();
    

    In my json, I have :

    "Id":null
    

提交回复
热议问题