Package com.veeva.vault.sdk.api.json
Interface JsonObject
public interface JsonObject
Represents a JSON object.
-
Method Summary
Modifier and TypeMethodDescriptionasString()Formats the object as aString.booleanDetermines if the specified property is present on the object.Retrieves aMaprepresenting the properties of the JSON object.<T> TgetValue(String name, JsonValueType<T> valueType) Retrieves the value of a property with the given name.
-
Method Details
-
getValue
Retrieves the value of a property with the given name.If there is no property with the given name, this throws an exception.
If the value for the given name is
null, this returnsnull.- Type Parameters:
T- the requested value type- Parameters:
name- the name of the property. Cannot be null.valueType- the requested value type. Cannot be null.- Returns:
- the value of a property with the given name
-
getProperties
Map<String,JsonProperty> getProperties()Retrieves aMaprepresenting the properties of the JSON object. The keys of theMapare the names of the properties, and the values areJsonPropertyobjects representing the types of the properties.- Returns:
- a
Mapof all properties of the JSON object
-
contains
Determines if the specified property is present on the object.- Parameters:
name- the name of the property. Cannot be null.- Returns:
- true if the property is present on the object; otherwise false
-
asString
String asString()Formats the object as aString.- Returns:
- the object as a
String
-