你当前正在访问 Microsoft Azure Global Edition 技术文档网站。 如果需要访问由世纪互联运营的 Microsoft Azure 中国技术文档网站,请访问 https://docs.azure.cn。
Attachment 类
- java.
lang. Object - JsonSerializable
- 资源
- com.
microsoft. azure. cosmosdb. Attachment
- com.
public class Attachment extends Resource
表示 Azure Cosmos DB 数据库服务中的文档附件。
每个文档可能包含零个或多个附件。 附件可以是任何 MIME 类型 - 文本、图像、二进制数据。 这些存储在 Azure Blob 存储的外部。 删除父文档时,会自动删除附件。
构造函数摘要
构造函数 | 说明 |
---|---|
Attachment() |
初始化附件对象。 |
Attachment(String source) |
从 json 字符串初始化附件对象。 |
方法摘要
修饰符和类型 | 方法和描述 |
---|---|
String |
getContentType()
获取附件的 MIME 内容类型。 |
String |
getMediaLink()
获取与附件内容关联的媒体链接。 |
void |
setContentType(String contentType)
设置附件的 MIME 内容类型。 |
void |
setMediaLink(String mediaLink)
设置与附件内容关联的媒体链接。 |
继承成员
JsonSerializable.get(String propertyName)
JsonSerializable.getBoolean(String propertyName)
JsonSerializable.getCollection(String propertyName)
JsonSerializable.getDouble(String propertyName)
Resource.getETag()
JsonSerializable.getHashMap()
Resource.getId()
JsonSerializable.getInt(String propertyName)
JsonSerializable.getLogger()
JsonSerializable.getLong(String propertyName)
JsonSerializable.getMapper()
JsonSerializable.getObject(String propertyName)
JsonSerializable.getObjectByPath(List<String> propertyNames)
Resource.getResourceId()
Resource.getSelfLink()
JsonSerializable.getString(String propertyName)
Resource.getTimestamp()
JsonSerializable.has(String propertyName)
JsonSerializable.JsonSerializable()
JsonSerializable.JsonSerializable(String jsonString, ObjectMapper objectMapper)
JsonSerializable.JsonSerializable(String jsonString)
JsonSerializable.remove(String propertyName)
Resource.Resource(Resource resource)
Resource.Resource()
Resource.Resource(String jsonString, ObjectMapper objectMapper)
Resource.Resource(String jsonString)
Resource.setId(String id)
Resource.setResourceId(String resourceId)
JsonSerializable.toJson()
JsonSerializable.toJson(SerializationFormattingPolicy formattingPolicy)
JsonSerializable.toString()
构造函数详细信息
Attachment
public Attachment()
初始化附件对象。
Attachment
public Attachment(String source)
从 json 字符串初始化附件对象。
Parameters:
source
- 附件的 json 字符串表示形式。
方法详细信息
getContentType
public String getContentType()
获取附件的 MIME 内容类型。
Returns:
内容类型。
getMediaLink
public String getMediaLink()
获取与附件内容关联的媒体链接。
Returns:
媒体链接。
setContentType
public void setContentType(String contentType)
设置附件的 MIME 内容类型。
Parameters:
contentType
- 要使用的内容类型。
setMediaLink
public void setMediaLink(String mediaLink)
设置与附件内容关联的媒体链接。
Parameters:
mediaLink
- 要使用的媒体链接。