Package com.veeva.vault.sdk.api.json
Interface JsonData
public interface JsonData
Represents immutable JSON.
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the top-levelJsonArray
for the JSON data.Retrieves the top-levelJsonObject
for the JSON data.boolean
Determines if the JSON is valid.
-
Method Details
-
isValidJson
boolean isValidJson()Determines if the JSON is valid.- Returns:
- true if the JSON is valid, otherwise false
-
getJsonObject
JsonObject getJsonObject()Retrieves the top-levelJsonObject
for the JSON data.If the JSON is not valid (for example,
isValidJson()
returnsfalse
) this throws an exception.If the top-level value is not a
JsonObject
, this throws an exception.- Returns:
- the top-level
JsonObject
for the JSON data
-
getJsonArray
JsonArray getJsonArray()Retrieves the top-levelJsonArray
for the JSON data.If the JSON is not valid (for example,
isValidJson()
returnsfalse
) this throws an exception.If the top-level value is not a
JsonArray
, this throws an exception.- Returns:
- the top-level
JsonArray
for the JSON data
-