0

I want to check Jsonnode value is present or not, As shown below myObj is an input. in this name is a key and "" is a value. I want to check if I get "" value then it should be go in else part. I tried by using following code but its not working.

JsonNode myObj = {name:""};

JsonNode node = myObj.get("name");

if(node != null && !node.isNull()){

// do some things with the item node

} else {

// do something else

}
user8995182
  • 175
  • 3
  • 6

1 Answers1

0

Have you tried something like this:

node != null && !node.isNull() && node.textValue().isEmpty()