java.lang.Object
it.auties.whatsapp.model.message.standard.PollCreationMessage
- All Implemented Interfaces:
it.auties.protobuf.model.ProtobufMessage,it.auties.protobuf.model.ProtobufObject,ContextualMessage,Message
A model class that represents a message holding a poll inside
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ContextInfoprivate byte[]private final List<PollOption> private final intprivate final Map<String, PollOption> private final Map<Jid, Collection<PollOption>> private final String -
Constructor Summary
ConstructorsConstructorDescriptionPollCreationMessage(byte[] encryptionKey, String title, List<PollOption> selectableOptions, int selectableOptionsCount, ContextInfo contextInfo) PollCreationMessage(byte[] encryptionKey, String title, List<PollOption> selectableOptions, int selectableOptionsCount, ContextInfo contextInfo, Map<String, PollOption> selectableOptionsMap, Map<Jid, Collection<PollOption>> selectedOptionsMap) -
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 pollintvoidsetEncryptionKey(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
-
selectedOptionsMap
-
-
Constructor Details
-
PollCreationMessage
public PollCreationMessage(byte[] encryptionKey, String title, List<PollOption> selectableOptions, int selectableOptionsCount, ContextInfo contextInfo, Map<String, PollOption> selectableOptionsMap, Map<Jid, Collection<PollOption>> selectedOptionsMap) -
PollCreationMessage
public PollCreationMessage(byte[] encryptionKey, String title, List<PollOption> selectableOptions, int selectableOptionsCount, ContextInfo contextInfo)
-
-
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
-