public class ConversationParticipantBuilderImpl extends Object implements ConversationParticipantBuilder
Modifier and Type | Field and Description |
---|---|
protected EngageEngineConfiguration |
configuration |
protected String |
conversationId |
protected List<String> |
participantsToDrop |
protected List<JoinParticipantsData> |
participantsToJoin |
Constructor and Description |
---|
ConversationParticipantBuilderImpl(EngageEngineConfiguration configuration,
String conversationId) |
Modifier and Type | Method and Description |
---|---|
ConversationParticipantBuilder |
dropParticipant(String userId)
Drops the given participant from the conversation.
|
ConversationParticipantBuilder |
dropParticipants(Collection<String> userIds)
Drops the given participants from the conversation.
|
ConversationParticipantBuilder |
dropParticipants(String... userIds)
Drops the given participants from the conversation.
|
String |
getConversationId() |
List<String> |
getParticipantsToDrop() |
List<JoinParticipantsData> |
getParticipantsToJoin() |
ParticipantJoiningBuilder |
joinParticipant(String userId)
Joins a single participant.
|
ParticipantJoiningBuilder |
joinParticipants(Collection<String> userIds)
Joins a collection of participants.
|
ParticipantJoiningBuilder |
joinParticipants(String... userIds)
Joins one or more participants.
|
void |
save()
Executes all collected join and drop commands and saves them.
|
protected void |
validateData()
Internal validation to check whether no participant is added and removed the same time.
|
protected final EngageEngineConfiguration configuration
protected final String conversationId
protected List<JoinParticipantsData> participantsToJoin
public ConversationParticipantBuilderImpl(EngageEngineConfiguration configuration, String conversationId)
public ParticipantJoiningBuilder joinParticipant(String userId)
ConversationParticipantBuilder
joinParticipant
in interface ConversationParticipantBuilder
userId
- the id of the user to be added as a new participantpublic ParticipantJoiningBuilder joinParticipants(String... userIds)
ConversationParticipantBuilder
joinParticipants
in interface ConversationParticipantBuilder
userIds
- the ids of the users to be added as a new participantspublic ParticipantJoiningBuilder joinParticipants(Collection<String> userIds)
ConversationParticipantBuilder
joinParticipants
in interface ConversationParticipantBuilder
userIds
- the ids of the users to be added as a new participantspublic ConversationParticipantBuilder dropParticipant(String userId)
ConversationParticipantBuilder
dropParticipant
in interface ConversationParticipantBuilder
userId
- the user to be dropped from the conversationpublic ConversationParticipantBuilder dropParticipants(String... userIds)
ConversationParticipantBuilder
dropParticipants
in interface ConversationParticipantBuilder
userIds
- the users to be dropped from the conversationpublic ConversationParticipantBuilder dropParticipants(Collection<String> userIds)
ConversationParticipantBuilder
dropParticipants
in interface ConversationParticipantBuilder
userIds
- the users to be dropped from the conversationprotected void validateData()
public void save()
ConversationParticipantBuilder
save
in interface ConversationParticipantBuilder
public String getConversationId()
public List<JoinParticipantsData> getParticipantsToJoin()