In Java, I know you can check if a key is present with the isNull() method. Is there a way to check what kind of data the key holds?
Consider the following examples.
I would want a function like JSONBody.getDataType("key") and it would return String
{
"key" : "value"
}
I would want a function like JSONBody.getDataType("key") and it would return JSONObject
{
"key" : {
"parm1" : "value1",
"parm2" : "value2"
}
}
I would want a function like JSONBody.getDataType("key") and it would return JSONArray
{
"key" : [
"value1",
"value2",
"value3"
]
}
I would want a function like JSONBody.getDataType("key") and it would return Boolean
{
"key" : true
}
Does something like this exist?