Package com.veeva.vault.sdk.api.json
Interface JsonData
public interface JsonData
Represents immutable JSON.
-
Method Summary
Modifier and TypeMethodDescriptionRetrieves the top-levelJsonArrayfor the JSON data.Retrieves the top-levelJsonObjectfor the JSON data.booleanDetermines 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-levelJsonObjectfor 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
JsonObjectfor the JSON data
-
getJsonArray
JsonArray getJsonArray()Retrieves the top-levelJsonArrayfor 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
JsonArrayfor the JSON data
-