Package com.azure.core.models
Class MessageContent
java.lang.Object
com.azure.core.models.MessageContent
Represents a message with a specific content type and data.
This class encapsulates a message that includes a content type and its corresponding data. The data is
represented as a BinaryData object, and the content type is a string.
This class is useful when you want to work with a message that includes a specific type of content and its corresponding data. For example, you can use it to represent a message with JSON data, XML data, or plain text data.
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGets the message body.Gets the content type.setBodyAsBinaryData(BinaryData binaryData) Sets the message body.setContentType(String contentType) Sets the content type.
-
Constructor Details
-
MessageContent
public MessageContent()Creates a new instance ofMessageContent.
-
-
Method Details
-
getBodyAsBinaryData
Gets the message body.- Returns:
- The message body.
-
setBodyAsBinaryData
Sets the message body.- Parameters:
binaryData- The message body.- Returns:
- The updated
MessageContentobject.
-
getContentType
Gets the content type.- Returns:
- The content type.
-
setContentType
Sets the content type.- Parameters:
contentType- The content type.- Returns:
- The updated
MessageContentobject.
-