java.lang.Object
it.auties.whatsapp.model.message.standard.PollCreationMessage
- All Implemented Interfaces:
it.auties.protobuf.model.ProtobufMessage,it.auties.protobuf.model.ProtobufObject,ContextualMessage<PollCreationMessage>,Message
public final class PollCreationMessage
extends Object
implements ContextualMessage<PollCreationMessage>
A model class that represents a message holding a poll inside
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ContextInfoprivate byte[]private final List<PollOption> private final int(package private) final Map<String, PollOption> (package private) final List<SelectedPollOption> private final String -
Constructor Summary
ConstructorsConstructorDescriptionPollCreationMessage(byte[] encryptionKey, String title, List<PollOption> selectableOptions, int selectableOptionsCount, ContextInfo contextInfo, Map<String, PollOption> selectableOptionsMap, List<SelectedPollOption> selectedOptions) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddSelectableOption(String hash, PollOption option) voidaddSelectedOptions(JidProvider voter, Collection<PollOption> voted) category()Return message categoryOptional<byte[]> getSelectableOption(String hash) getSelectedOptions(JidProvider voter) Returns an unmodifiable list of the options that a contact voted in this pollintsetContextInfo(ContextInfo contextInfo) voidsetEncryptionKey(byte[] encryptionKey) (package private) static PollCreationMessagesimpleBuilder(String title, List<PollOption> selectableOptions) Constructs a new builder to create a PollCreationMessage The newsletters can be later sent usingWhatsapp.sendMessage(ChatMessageInfo)title()type()Return message type
-
Field Details
-
encryptionKey
private byte[] encryptionKey -
title
-
selectableOptions
-
selectableOptionsCount
private final int selectableOptionsCount -
contextInfo
-
selectableOptionsMap
-
selectedOptions
-
-
Constructor Details
-
PollCreationMessage
public PollCreationMessage(byte[] encryptionKey, String title, List<PollOption> selectableOptions, int selectableOptionsCount, ContextInfo contextInfo, Map<String, PollOption> selectableOptionsMap, List<SelectedPollOption> selectedOptions)
-
-
Method Details
-
simpleBuilder
Constructs a new builder to create a PollCreationMessage The newsletters can be later sent usingWhatsapp.sendMessage(ChatMessageInfo)- Parameters:
title- the non-null title of the pollselectableOptions- the null-null non-empty options of the poll- Returns:
- a non-null new message
-
getSelectedOptions
Returns an unmodifiable list of the options that a contact voted in this poll- Parameters:
voter- the non-null contact that voted in this poll- Returns:
- a non-null unmodifiable map
-
addSelectedOptions
-
addSelectableOption
-
getSelectableOption
-
type
Description copied from interface:MessageReturn message type -
category
Description copied from interface:MessageReturn message category -
title
-
selectableOptions
-
selectableOptionsCount
public int selectableOptionsCount() -
encryptionKey
-
setEncryptionKey
public void setEncryptionKey(byte[] encryptionKey) -
contextInfo
- Specified by:
contextInfoin interfaceContextualMessage<PollCreationMessage>
-
setContextInfo
- Specified by:
setContextInfoin interfaceContextualMessage<PollCreationMessage>
-