Package com.vonage.client.conversations
Class MessageEvent
java.lang.Object
com.vonage.client.JsonableBaseObject
com.vonage.client.conversations.Event
com.vonage.client.conversations.MessageEvent
- All Implemented Interfaces:
Jsonable
Represents a
EventType.MESSAGE event. All possible fields are presented and accessible,
but only those applicable to the message type will be populated. Use getMessageType()
to determine the type of message, and query the other fields accordingly.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classBuilder for configuring parameters of the event request. -
Method Summary
Modifier and TypeMethodDescriptionstatic MessageEvent.Builderbuilder(MessageType messageType) Entry point for constructing an instance of this class.If getMessageType() is MessageType.LOCATION, returns the location.Describes the media type for this event.getText()If getMessageType() is MessageType.TEXT, returns the text.getUrl()If getMessageType() is multimedia, returns the URL of the media.Methods inherited from class com.vonage.client.conversations.Event
getFrom, getFromMember, getFromUser, getId, getTimestamp, getTypeMethods inherited from class com.vonage.client.JsonableBaseObject
createJsonObjectMapper, equals, hashCode, toStringMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.vonage.client.Jsonable
toJson, updateFromJson
-
Method Details
-
getMessageType
Describes the media type for this event.- Returns:
- The message type as an enum.
-
getText
If getMessageType() is MessageType.TEXT, returns the text.- Returns:
- The message text, or
nullif not applicable.
-
getUrl
If getMessageType() is multimedia, returns the URL of the media.- Returns:
- The absolute media URL, or
nullif not applicable.
-
getLocation
If getMessageType() is MessageType.LOCATION, returns the location.- Returns:
- The location details, or
nullif not applicable.
-
builder
Entry point for constructing an instance of this class.- Parameters:
messageType- The type of message for this event.- Returns:
- A new Builder.
-