public class ChatRoomMessageBuilder
extends java.lang.Object
| Constructor and Description |
|---|
ChatRoomMessageBuilder() |
| Modifier and Type | Method and Description |
|---|---|
static ChatRoomMessage |
createChatRoomAudioMessage(java.lang.String roomId,
java.io.File file,
long duration)
Create an audio message
|
static ChatRoomMessage |
createChatRoomAudioMessage(java.lang.String roomId,
java.io.File file,
long duration,
java.lang.String nosTokenSceneKey)
Create an audio message and specify the NOS scene key for upload.
|
static ChatRoomMessage |
createChatRoomCustomMessage(java.lang.String roomId,
MsgAttachment attachment)
Create a custom message
|
static ChatRoomMessage |
createChatRoomCustomMessage(java.lang.String roomId,
MsgAttachment attachment,
java.lang.String nosTokenScene)
Create a custom message with a specified NOS scene if any for upload
|
static ChatRoomMessage |
createChatRoomFileMessage(java.lang.String roomId,
java.io.File file,
java.lang.String displayName)
Create a file message
|
static ChatRoomMessage |
createChatRoomFileMessage(java.lang.String roomId,
java.io.File file,
java.lang.String displayName,
java.lang.String nosTokenSceneKey)
Create a file message and specify the NOS scene key for upload
|
static ChatRoomMessage |
createChatRoomImageMessage(java.lang.String roomId,
java.io.File file,
java.lang.String displayName)
Create an image message
|
static ChatRoomMessage |
createChatRoomImageMessage(java.lang.String roomId,
java.io.File file,
java.lang.String displayName,
java.lang.String nosTokenSceneKey)
Create an image message and specify the NOS scene key for upload.
|
static ChatRoomMessage |
createChatRoomLocationMessage(java.lang.String roomId,
double lat,
double lng,
java.lang.String addr)
Create a location message
|
static ChatRoomMessage |
createChatRoomSpatialLocationTextMessage(java.lang.String roomId,
java.lang.String text,
java.lang.Double x,
java.lang.Double y,
java.lang.Double z)
Create a text message
|
static ChatRoomMessage |
createChatRoomTextMessage(java.lang.String roomId,
java.lang.String text)
Create a text message
|
static ChatRoomMessage |
createChatRoomVideoMessage(java.lang.String roomId,
java.io.File file,
long duration,
int width,
int height,
java.lang.String displayName)
Create a video message
|
static ChatRoomMessage |
createChatRoomVideoMessage(java.lang.String roomId,
java.io.File file,
long duration,
int width,
int height,
java.lang.String displayName,
java.lang.String nosTokenSceneKey)
Create a video message and specify the NOS scene key for upload
|
static ChatRoomMessage |
createEmptyChatRoomMessage(java.lang.String roomId,
long time)
Create an empty message with only the session ID and the time for query
|
static ChatRoomMessage |
createRobotMessage(java.lang.String roomId,
java.lang.String robotAccount,
java.lang.String text,
java.lang.String type,
java.lang.String content,
java.lang.String target,
java.lang.String params) |
static ChatRoomMessage |
createTipMessage(java.lang.String roomId)
Create a tip message
|
public static ChatRoomMessage createChatRoomTextMessage(java.lang.String roomId, java.lang.String text)
roomId - chat room IDtext - text messagepublic static ChatRoomMessage createChatRoomCustomMessage(java.lang.String roomId, MsgAttachment attachment)
roomId - chat room IDattachment - message attachmentpublic static ChatRoomMessage createChatRoomCustomMessage(java.lang.String roomId, MsgAttachment attachment, java.lang.String nosTokenScene)
roomId - chat room IDattachment - message attachmentnosTokenScene - nos scene for uploadpublic static ChatRoomMessage createChatRoomImageMessage(java.lang.String roomId, java.io.File file, java.lang.String displayName)
roomId - chat room IDfile - Image filedisplayName - The display name of an image file that can be different from the file name.public static ChatRoomMessage createChatRoomImageMessage(java.lang.String roomId, java.io.File file, java.lang.String displayName, java.lang.String nosTokenSceneKey)
roomId - chat room IDfile - Image filedisplayName - The display name of an image file that can be different from the file name.nosTokenSceneKey - The NOS scene key of an image used for upload. The default value is NimNosSceneKeyConstant#NIM_DEFAULT_IM.public static ChatRoomMessage createChatRoomAudioMessage(java.lang.String roomId, java.io.File file, long duration)
roomId - chat room IDfile - audio fileduration - duration of an audio file in millisecondspublic static ChatRoomMessage createChatRoomAudioMessage(java.lang.String roomId, java.io.File file, long duration, java.lang.String nosTokenSceneKey)
roomId - chat room IDfile - audio fileduration - The duration of an audio file. Unit: millisecondsnosTokenSceneKey - The NOS scene key of an audio file used for upload. The default value is NimNosSceneKeyConstant#NIM_DEFAULT_IM.public static ChatRoomMessage createChatRoomLocationMessage(java.lang.String roomId, double lat, double lng, java.lang.String addr)
roomId - chat room IDlat - Latitudelng - Longitudeaddr - The location descriptionpublic static ChatRoomMessage createChatRoomVideoMessage(java.lang.String roomId, java.io.File file, long duration, int width, int height, java.lang.String displayName)
roomId - chat room IDfile - Video fileduration - Duration of a video filewidth - Video widthheight - Video heightdisplayName - The display name of the video file. The parameter can be empty.public static ChatRoomMessage createChatRoomVideoMessage(java.lang.String roomId, java.io.File file, long duration, int width, int height, java.lang.String displayName, java.lang.String nosTokenSceneKey)
roomId - chat room IDfile - Video fileduration - Duration of a video filewidth - Video widthheight - Video heightdisplayName - The display name of the video file. The parameter can be empty.nosTokenSceneKey - The NOS scene key of a video file used for upload. The default value is NimNosSceneKeyConstant#NIM_DEFAULT_IM.public static ChatRoomMessage createChatRoomFileMessage(java.lang.String roomId, java.io.File file, java.lang.String displayName)
roomId - chat room IDfile - FiledisplayName - The display name of the file that can be different from the file name.public static ChatRoomMessage createChatRoomFileMessage(java.lang.String roomId, java.io.File file, java.lang.String displayName, java.lang.String nosTokenSceneKey)
roomId - chat room IDfile - FiledisplayName - The display name of the file that can be different from the file name.nosTokenSceneKey - The NOS scene key used for upload. The default value is NimNosSceneKeyConstant#NIM_DEFAULT_IM.public static ChatRoomMessage createChatRoomSpatialLocationTextMessage(java.lang.String roomId, java.lang.String text, java.lang.Double x, java.lang.Double y, java.lang.Double z)
roomId - chat room IDtext - text messagex - x coordinatey - y coordinatez - z coordinatepublic static ChatRoomMessage createTipMessage(java.lang.String roomId)
roomId - chat room IDpublic static ChatRoomMessage createRobotMessage(java.lang.String roomId, java.lang.String robotAccount, java.lang.String text, java.lang.String type, java.lang.String content, java.lang.String target, java.lang.String params)
roomId - chat room IDrobotAccount - Bot accounttext - The message text. In most cases, the display message contains the content plus @bot tag.type - Bot message type. For more information, see RobotMsgTypecontent - The message content. If the message type is RobotMsgType.TEXT, the content must be specified.target - If the message type is RobotMsgType.LINK, the target link that is redirected to must be specified.params - If the message type is RobotMsgType.LINK, parameters must be specified.public static ChatRoomMessage createEmptyChatRoomMessage(java.lang.String roomId, long time)
time - The start time of a query