public class MessageListParams
extends java.lang.Object
BaseChannel.getMessagesByTimestamp(long, MessageListParams, BaseChannel.GetMessagesHandler)
.
BaseChannel.getMessagesByMessageId(long, MessageListParams, BaseChannel.GetMessagesHandler)
.Constructor and Description |
---|
MessageListParams() |
MessageListParams(int previousResultSize,
int nextResultSize,
BaseChannel.MessageTypeFilter messageType,
java.util.Collection<java.lang.String> customTypes,
java.util.List<java.lang.String> senderUserIds,
boolean inclusive,
boolean reverse,
boolean includeMetaArray,
boolean includeReactions,
boolean includeParentMessageInfo,
boolean includeThreadInfo,
boolean includeReplies) |
MessageListParams(int previousResultSize,
int nextResultSize,
BaseChannel.MessageTypeFilter messageType,
java.util.Collection<java.lang.String> customTypes,
java.util.List<java.lang.String> senderUserIds,
boolean inclusive,
boolean reverse,
MessagePayloadFilter messagePayloadFilter,
ReplyTypeFilter replyTypeFilter) |
MessageListParams(int previousResultSize,
int nextResultSize,
BaseChannel.MessageTypeFilter messageType,
java.util.Collection<java.lang.String> customTypes,
java.util.List<java.lang.String> senderUserIds,
boolean inclusive,
boolean reverse,
MessagePayloadFilter messagePayloadFilter,
ReplyTypeFilter replyTypeFilter,
boolean showSubchannelMessagesOnly) |
MessageListParams(int previousResultSize,
int nextResultSize,
BaseChannel.MessageTypeFilter messageType,
java.lang.String customType,
java.util.List<java.lang.String> senderUserIds,
boolean inclusive,
boolean reverse,
boolean includeMetaArray,
boolean includeReactions,
boolean includeParentMessageInfo,
boolean includeThreadInfo,
boolean includeReplies) |
MessageListParams(int previousResultSize,
int nextResultSize,
BaseChannel.MessageTypeFilter messageType,
java.lang.String customType,
java.util.List<java.lang.String> senderUserIds,
boolean inclusive,
boolean reverse,
MessagePayloadFilter messagePayloadFilter,
boolean includeReplies) |
MessageListParams(int previousResultSize,
int nextResultSize,
BaseChannel.MessageTypeFilter messageType,
java.lang.String customType,
java.util.List<java.lang.String> senderUserIds,
boolean inclusive,
boolean reverse,
MessagePayloadFilter messagePayloadFilter,
ReplyTypeFilter replyTypeFilter,
boolean showSubchannelMessagesOnly) |
Modifier and Type | Method and Description |
---|---|
boolean |
belongsTo(BaseMessage message)
Verify that the given channel information matches the current query filter.
|
boolean |
belongsTo(BaseMessageParams params)
Verify that the given
BaseMessageParams information matches the current query filter. |
MessageListParams |
clone()
Clones and returns a new instance of
MessageListParams . |
java.lang.String |
getCustomType()
Returns the custom type of message.
|
java.util.Collection<java.lang.String> |
getCustomTypes()
Returns the custom types of message.
|
MessagePayloadFilter |
getMessagePayloadFilter()
Returns the
MessagePayloadFilter set in this param. |
BaseChannel.MessageTypeFilter |
getMessageType()
Returns the message type.
|
int |
getNextResultSize()
Returns the number of newer messages that you want to get.
|
int |
getPreviousResultSize()
Returns the number of previous messages that you want to get.
|
ReplyTypeFilter |
getReplyTypeFilter()
Returns the
ReplyTypeFilter which should be included in the results. |
java.util.List<java.lang.String> |
getSenderUserIds()
Returns the sender user ids.
|
boolean |
isInclusive()
Returns a value whether to include the messages sent exactly on the specified timestamp or have the matching message ID in the results.
|
void |
setCustomType(java.lang.String customType)
Restricts the search scope only to retrieve the messages with the specified custom message type.
|
void |
setCustomTypes(java.util.Collection<java.lang.String> customTypes)
Restricts the search scope only to retrieve the messages that match any of given custom
types.
|
void |
setIncludeMetaArray(boolean includeMetaArray)
Determines whether to include the meta array information of the updated messages in the results.
|
void |
setIncludeParentMessageText(boolean includeParentMessageText)
Deprecated.
As of 3.0.173, replaced by
MessagePayloadFilter.setIncludeParentMessageInfo(boolean) by setMessagePayloadFilter(MessagePayloadFilter) . |
void |
setIncludeReactions(boolean includeReactions)
Determines whether to include the reactions to the updated messages in the results.
|
void |
setIncludeReplies(boolean includeReplies)
Deprecated.
As of 3.0.173, replaced by
setReplyTypeFilter(ReplyTypeFilter) . |
void |
setIncludeThreadInfo(boolean includeThreadInfo)
Determines whether to include the thread information of the updated messages in the results when the results contain parent messages.
|
void |
setInclusive(boolean inclusive)
Determines whether to include the messages sent exactly on the specified timestamp or have the matching message ID in the results.
|
void |
setMessagePayloadFilter(MessagePayloadFilter messagePayloadFilter)
Sets the
MessagePayloadFilter to be used in retrieving message lists. |
void |
setMessageType(BaseChannel.MessageTypeFilter messageType)
Restricts the search scope only to retrieve the messages with the specified message type.
|
void |
setNextResultSize(int nextResultSize)
Set the number of newer messages added either before the timestamp or the message that has a specific message ID.
|
void |
setPreviousResultSize(int previousResultSize)
Set the number of previous messages added either before the timestamp or the message that has a specific message ID.
|
void |
setReplyTypeFilter(ReplyTypeFilter replyTypeFilter)
Determines the reply types to include in the results.
|
void |
setReverse(boolean reverse)
Determines whether to sort the retrieved messages in reverse order.
|
void |
setSenderUserIds(java.util.List<java.lang.String> senderUserIds)
Restricts the search scope only to retrieve the messages sent by the users with the specified user IDs.
|
void |
setShowSubchannelMessagesOnly(boolean showSubchannelMessagesOnly)
If set to true, only messages that belong to current user's subchannel is fetched.
|
boolean |
shouldIncludeMetaArray()
Returns whether the meta arrays should be included in the results.
|
boolean |
shouldIncludeParentMessageText()
Deprecated.
As of 3.0.173, replaced by
MessagePayloadFilter.shouldIncludeParentMessageInfo() from getMessagePayloadFilter() . |
boolean |
shouldIncludeReactions()
Returns whether the reaction data should be included in the results.
|
boolean |
shouldIncludeReplies()
Deprecated.
As of 3.0.173, replaced by
getReplyTypeFilter() . |
boolean |
shouldIncludeThreadInfo()
Returns whether the thread information should be included in the results.
|
boolean |
shouldReverse()
Returns whether the results should be reversed.
|
boolean |
shouldShowSubchannelMessagesOnly()
If true, only messages that belong to current user's subchannel is fetched.
|
java.lang.String |
toString() |
public MessageListParams()
public MessageListParams(int previousResultSize, int nextResultSize, BaseChannel.MessageTypeFilter messageType, java.util.Collection<java.lang.String> customTypes, java.util.List<java.lang.String> senderUserIds, boolean inclusive, boolean reverse, MessagePayloadFilter messagePayloadFilter, ReplyTypeFilter replyTypeFilter, boolean showSubchannelMessagesOnly)
public MessageListParams(int previousResultSize, int nextResultSize, BaseChannel.MessageTypeFilter messageType, java.lang.String customType, java.util.List<java.lang.String> senderUserIds, boolean inclusive, boolean reverse, MessagePayloadFilter messagePayloadFilter, ReplyTypeFilter replyTypeFilter, boolean showSubchannelMessagesOnly)
public MessageListParams(int previousResultSize, int nextResultSize, BaseChannel.MessageTypeFilter messageType, java.util.Collection<java.lang.String> customTypes, java.util.List<java.lang.String> senderUserIds, boolean inclusive, boolean reverse, MessagePayloadFilter messagePayloadFilter, ReplyTypeFilter replyTypeFilter)
public MessageListParams(int previousResultSize, int nextResultSize, BaseChannel.MessageTypeFilter messageType, java.lang.String customType, java.util.List<java.lang.String> senderUserIds, boolean inclusive, boolean reverse, MessagePayloadFilter messagePayloadFilter, boolean includeReplies)
public MessageListParams(int previousResultSize, int nextResultSize, BaseChannel.MessageTypeFilter messageType, java.lang.String customType, java.util.List<java.lang.String> senderUserIds, boolean inclusive, boolean reverse, boolean includeMetaArray, boolean includeReactions, boolean includeParentMessageInfo, boolean includeThreadInfo, boolean includeReplies)
public MessageListParams(int previousResultSize, int nextResultSize, BaseChannel.MessageTypeFilter messageType, java.util.Collection<java.lang.String> customTypes, java.util.List<java.lang.String> senderUserIds, boolean inclusive, boolean reverse, boolean includeMetaArray, boolean includeReactions, boolean includeParentMessageInfo, boolean includeThreadInfo, boolean includeReplies)
public void setIncludeThreadInfo(boolean includeThreadInfo)
MessagePayloadFilter.setIncludeThreadInfo(boolean)
.includeThreadInfo
- If true
the result will be returned with thread information included.setMessagePayloadFilter(MessagePayloadFilter).
@Deprecated public void setIncludeReplies(boolean includeReplies)
setReplyTypeFilter(ReplyTypeFilter)
.includeReplies
- If true
the result will be returned with reply messages included.public void setShowSubchannelMessagesOnly(boolean showSubchannelMessagesOnly)
showSubchannelMessagesOnly
- If false, all messages will be returned. If true,
only messages in the subchannel will be returned.public void setReplyTypeFilter(ReplyTypeFilter replyTypeFilter)
replyTypeFilter
- The ReplyTypeFilter
of the replies to include in the result. Shouldn't be null.public boolean shouldIncludeThreadInfo()
getMessagePayloadFilter()
.@Deprecated public boolean shouldIncludeReplies()
getReplyTypeFilter()
.public boolean shouldShowSubchannelMessagesOnly()
public ReplyTypeFilter getReplyTypeFilter()
ReplyTypeFilter
which should be included in the results.ReplyTypeFilter
which should be included in the results.public MessageListParams clone()
MessageListParams
.clone
in class java.lang.Object
MessageListParams
.public java.lang.String toString()
public boolean belongsTo(BaseMessage message)
message
- BaseMessage to check. Returns false if the message is not matched with the param's filter.public boolean belongsTo(BaseMessageParams params)
BaseMessageParams
information matches the current query filter.params
- BaseMessageParams
to check. Returns false if the BaseMessageParams
is not matched with the current params's filter.public void setPreviousResultSize(int previousResultSize)
previousResultSize
- number of loaded message size.public void setNextResultSize(int nextResultSize)
nextResultSize
- number of loaded message size.public void setMessageType(BaseChannel.MessageTypeFilter messageType)
messageType
- type of messages that should be loaded.public void setCustomType(java.lang.String customType)
customType
- custom type for messages.public void setCustomTypes(java.util.Collection<java.lang.String> customTypes)
customTypes
- custom types for the messages.public void setSenderUserIds(java.util.List<java.lang.String> senderUserIds)
senderUserIds
- list of sender's user ids.public void setInclusive(boolean inclusive)
inclusive
- If true
, the result will include messages with createdAt same as the given timestamp.public void setReverse(boolean reverse)
reverse
- If true
the result will be returned by creation time descending order.public void setIncludeMetaArray(boolean includeMetaArray)
MessagePayloadFilter.setIncludeMetaArray(boolean)
.includeMetaArray
- If true
the result will be returned with message meta array.setMessagePayloadFilter(MessagePayloadFilter).
public void setIncludeReactions(boolean includeReactions)
MessagePayloadFilter.setIncludeReactions(boolean)
.includeReactions
- If true
the result will be returned with message reactions.setMessagePayloadFilter(MessagePayloadFilter).
@Deprecated public void setIncludeParentMessageText(boolean includeParentMessageText)
MessagePayloadFilter.setIncludeParentMessageInfo(boolean)
by setMessagePayloadFilter(MessagePayloadFilter)
.BaseMessage.getMessage()
of the parent message.
If it is FileMessage, the value is the name of the uploaded file.
Internally, this will be set on MessagePayloadFilter.setIncludeParentMessageInfo(boolean)
.includeParentMessageText
- If true
the result will be returned with messages with parent's message's text, if the message is a reply message.setMessagePayloadFilter(MessagePayloadFilter).
public void setMessagePayloadFilter(MessagePayloadFilter messagePayloadFilter)
MessagePayloadFilter
to be used in retrieving message lists.
This is more preferred way of setting other include flags.messagePayloadFilter
- MessagePayloadFilter
with preferred filters set.public int getPreviousResultSize()
public int getNextResultSize()
public BaseChannel.MessageTypeFilter getMessageType()
public java.lang.String getCustomType()
public java.util.Collection<java.lang.String> getCustomTypes()
public java.util.List<java.lang.String> getSenderUserIds()
public boolean isInclusive()
public boolean shouldReverse()
public boolean shouldIncludeMetaArray()
getMessagePayloadFilter()
.public boolean shouldIncludeReactions()
getMessagePayloadFilter()
.@Deprecated public boolean shouldIncludeParentMessageText()
MessagePayloadFilter.shouldIncludeParentMessageInfo()
from getMessagePayloadFilter()
.getMessagePayloadFilter()
.public MessagePayloadFilter getMessagePayloadFilter()
MessagePayloadFilter
set in this param.MessagePayloadFilter
. Copyright © 2021, Sendbird or its affiliates. All rights reserved.
Report a bug or request a feature
For further developer documentation, see Chat SDK Documentation. That documentation contains more detailed descriptions, conceptual overviews, definitions of terms, and code examples.