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
.boolean
Determines if the specified property is present on the object.Retrieves aMap
representing the properties of the JSON object.<T> T
getValue
(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 aMap
representing the properties of the JSON object. The keys of theMap
are the names of the properties, and the values areJsonProperty
objects representing the types of the properties.- Returns:
- a
Map
of 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
-