你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
JsonSerializable 类
- java.
lang. Object - com.
microsoft. azure. cosmosdb. JsonSerializable
- com.
public class JsonSerializable
表示可在 Azure Cosmos DB 数据库服务中序列化为 JSON 的基本资源。
构造函数摘要
构造函数 | 说明 | |
---|---|---|
JsonSerializable() | ||
JsonSerializable(String jsonString) |
构造函数。 |
|
JsonSerializable(String jsonString, ObjectMapper objectMapper) |
构造函数。 |
方法摘要
构造函数详细信息
JsonSerializable
protected JsonSerializable()
JsonSerializable
protected JsonSerializable(String jsonString)
构造函数。
参数:
JsonSerializable
protected JsonSerializable(String jsonString, ObjectMapper objectMapper)
构造函数。
参数:
方法详细信息
get
public Object get(String propertyName)
获取 Object 的属性值。
参数:
返回:
getBoolean
public Boolean getBoolean(String propertyName)
获取一个布尔值。
参数:
返回:
getCollection
public Collection
获取 JSONObject 集合。
参数:
返回:
getCollection
public
获取对象集合。
参数:
返回:
getDouble
public Double getDouble(String propertyName)
获取双精度值。
参数:
返回:
getHashMap
public HashMap
返回 hashMap 中 jsonObject) (属性包
返回:
getInt
public Integer getInt(String propertyName)
获取整数值。
参数:
返回:
getList
public
获取对象 List。
参数:
返回:
getLogger
protected Logger getLogger()
getLong
public Long getLong(String propertyName)
获取一个长值。
参数:
返回:
getMapper
protected ObjectMapper getMapper()
getObject
public ObjectNode getObject(String propertyName)
获取 JSONObject。
参数:
返回:
getObject
public
获取对象值。
参数:
返回:
getObjectByPath
public Object getObjectByPath(List
获取由构成路径的属性名称数组标识的属性的值。
参数:
返回:
getString
public String getString(String propertyName)
获取字符串值。
参数:
返回:
has
public boolean has(String propertyName)
检查是否存在属性。
参数:
返回:
remove
public void remove(String propertyName)
按 propertyName 删除值。
参数:
set
public
设置属性的值。
参数:
toJson
public String toJson()
转换为 JSON 字符串。
返回:
toJson
public String toJson(SerializationFormattingPolicy formattingPolicy)
转换为 JSON 字符串。
参数:
返回:
toObject
public
) 仅支持将 转换为对象 (POJO 和 JSONObject。
参数:
返回: