Intelligent Assistant
Chat with our virtual assistant to get answers promptly.
java.lang.Object |---com.huawei.wearengine.p2p.Message.Builder |
It is the building class in Message.
Modifier and Type | Method and Description |
|---|---|
build() Indicates the builder for Message. | |
setDescription(java.lang.String description) Sets description. | |
setPayload(byte[] sourceData) Sets the data to be transmitted. | |
setPayload(java.io.File sourceFile) Sets the file to be transferred. |
public Builder()
Since:
API level 0 (SDK 5.0.0.301)
public Message.Builder setPayload(byte[] sourceData)
It is used to set the data to be transmitted.
Parameters:
Parameter Name | Parameter Description |
|---|---|
sourceData | Data to be transmitted. |
Returns:
Built object in Message.
Since:
API level 0 (SDK 5.0.0.301)
public Message.Builder setPayload(java.io.File sourceFile)
It is used to set the files to be transferred.
Parameters:
Parameter Name | Parameter Description |
|---|---|
sourceFile | File to be transferred. |
Returns:
Built object in Message.
Since:
API level 0 (SDK 5.0.0.301)
public Message.Builder setDescription(java.lang.String description)
It is used to set the description of a file.
This API takes effect only when a file is being sent and does not need to be called when a message is being sent. Even if Description has been set for sending a message, the value of Description cannot be obtained using getDescription when the message is being sent.
Parameters:
Parameter Name | Parameter Description |
|---|---|
description | Description to be set. |
Returns:
Built object in Message.
Since:
API level 0 (SDK 5.0.0.301)
public Message build()
It indicates the builder for Message.
Returns:
Message
Since:
API level 0 (SDK 5.0.0.301)