Package io.smooch.core
Class ConversationEvent
- java.lang.Object
-
- io.smooch.core.ConversationEvent
-
- All Implemented Interfaces:
java.io.Serializable
public final class ConversationEvent extends java.lang.Object implements java.io.Serializable
Object representing a conversation event.- See Also:
ConversationEventType
, Serialized Form
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getAvatarUrl()
Returns the avatar URL of the participant related to this event if this event type isConversationEventType.CONVERSATION_READ
,ConversationEventType.TYPING_START
orConversationEventType.TYPING_STOP
.java.lang.String
getConversationId()
Returns the ID of the parent conversation of this event.java.util.Date
getLastRead()
Returns the date of the last read message if this event type isConversationEventType.CONVERSATION_READ
.java.lang.String
getName()
Returns the name of the participant related to this event if this event type isConversationEventType.CONVERSATION_READ
,ConversationEventType.TYPING_START
orConversationEventType.TYPING_STOP
.java.lang.String
getRole()
Returns the role of the participant related to this event (typically "appUser" or "business") if this event type isConversationEventType.CONVERSATION_READ
,ConversationEventType.TYPING_START
orConversationEventType.TYPING_STOP
.ConversationEventType
getType()
The type of event that is being triggered.java.lang.String
getUserId()
Always available forConversationEventType.PARTICIPANT_ADDED
andConversationEventType.PARTICIPANT_REMOVED
.
-
-
-
Method Detail
-
getConversationId
public java.lang.String getConversationId()
Returns the ID of the parent conversation of this event.- Returns:
- the ID of the parent conversation of this event
-
getType
public ConversationEventType getType()
The type of event that is being triggered. SeeConversationEventType
for possible types- Returns:
- The activity type
-
getUserId
public java.lang.String getUserId()
Always available forConversationEventType.PARTICIPANT_ADDED
andConversationEventType.PARTICIPANT_REMOVED
.Available for
ConversationEventType.CONVERSATION_READ
,ConversationEventType.TYPING_START
andConversationEventType.TYPING_STOP
if they were triggered by another app user.- Returns:
- the user ID if available, null otherwise
-
getRole
public java.lang.String getRole()
Returns the role of the participant related to this event (typically "appUser" or "business") if this event type isConversationEventType.CONVERSATION_READ
,ConversationEventType.TYPING_START
orConversationEventType.TYPING_STOP
.- Returns:
- the role of the participant related to this event, or null if this event has no related participants
-
getName
public java.lang.String getName()
Returns the name of the participant related to this event if this event type isConversationEventType.CONVERSATION_READ
,ConversationEventType.TYPING_START
orConversationEventType.TYPING_STOP
.- Returns:
- the name of the participant related to this event, or null if this event has no related participants
-
getAvatarUrl
public java.lang.String getAvatarUrl()
Returns the avatar URL of the participant related to this event if this event type isConversationEventType.CONVERSATION_READ
,ConversationEventType.TYPING_START
orConversationEventType.TYPING_STOP
.- Returns:
- the avatar URL of the participant related to this event, or null if this event has no related participants
-
getLastRead
public java.util.Date getLastRead()
Returns the date of the last read message if this event type isConversationEventType.CONVERSATION_READ
.- Returns:
- the date of the last read message if applicable to this event, null otherwise
-
-