Package com.cometchat.pro.core
Class MessagesRequest.MessagesRequestBuilder
- java.lang.Object
-
- com.cometchat.pro.core.MessagesRequest.MessagesRequestBuilder
-
- Enclosing class:
- MessagesRequest
public static class MessagesRequest.MessagesRequestBuilder extends java.lang.Object
Builder class to set various parameters to fetch list of Messages
-
-
Constructor Summary
Constructors Constructor Description MessagesRequestBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description MessagesRequest
build()
MessagesRequest.MessagesRequestBuilder
hideDeletedMessages(boolean hideDeleted)
A method to hide deleted messages from list of messages to be fetched.MessagesRequest.MessagesRequestBuilder
hideMessagesFromBlockedUsers(boolean hideMessagesFromBlockedUsers)
Method to set parameters to hide or show message from blocked users while fetchingMessagesRequest.MessagesRequestBuilder
hideReplies(boolean hideReplies)
A method to exclude threaded messages while fecthing messages for Users/Groups.MessagesRequest.MessagesRequestBuilder
setCategories(java.util.List<java.lang.String> categories)
A method to set parameter to get the messages belonging to a specific category.MessagesRequest.MessagesRequestBuilder
setCategory(java.lang.String category)
Deprecated.MessagesRequest.MessagesRequestBuilder
setGUID(java.lang.String GUID)
A method to set GUID of a Group to get messages of particular conversationMessagesRequest.MessagesRequestBuilder
setLimit(int limit)
MessagesRequest.MessagesRequestBuilder
setMessageId(int messageId)
A method to set Message Id of a particular message from which developer can callor fetchPrevious()
MessagesRequest.MessagesRequestBuilder
setParentMessageId(int parentMessageId)
A method to set parent id to retrieve messages only belonging to the particular thread.MessagesRequest.MessagesRequestBuilder
setSearchKeyword(java.lang.String searchKeyword)
A method set Search keyword while fetching the messagesMessagesRequest.MessagesRequestBuilder
setTags(java.util.List<java.lang.String> tags)
A method set the tags for which the messages are to be fetchedMessagesRequest.MessagesRequestBuilder
setTimestamp(long timestamp)
A method to set timestamp from which developer can callor fetchPrevious()
MessagesRequest.MessagesRequestBuilder
setType(java.lang.String type)
Deprecated.MessagesRequest.MessagesRequestBuilder
setTypes(java.util.List<java.lang.String> types)
A method to set parameter to get the messages belonging to a specific type.MessagesRequest.MessagesRequestBuilder
setUID(java.lang.String UID)
A method to set UID of a User to get messages of particular conversationMessagesRequest.MessagesRequestBuilder
setUnread(boolean unread)
Method to set unread message while fetchingMessagesRequest.MessagesRequestBuilder
setUpdatedAfter(long updatedAfter)
A method set timestamp to get fetch messages updated/edited after that timestampMessagesRequest.MessagesRequestBuilder
updatesOnly(boolean updatesOnly)
A method to set parameter to get edited/updated messagesMessagesRequest.MessagesRequestBuilder
withTags(boolean withTags)
A method to inform the SDK that the messages to be fetched are to be fetched along with the tags.
-
-
-
Method Detail
-
setLimit
public MessagesRequest.MessagesRequestBuilder setLimit(int limit)
- Parameters:
limit
- Integer value specified by the Developer- Returns:
- MessagesRequestBuilder object when
is called - Since:
- v1
-
setUID
public MessagesRequest.MessagesRequestBuilder setUID(java.lang.String UID)
A method to set UID of a User to get messages of particular conversation- Parameters:
UID
- Unique Identifier of a User- Returns:
- MessagesRequestBuilder object when
is called - Since:
- v1
-
setGUID
public MessagesRequest.MessagesRequestBuilder setGUID(java.lang.String GUID)
A method to set GUID of a Group to get messages of particular conversation- Parameters:
GUID
- Unique Identifier of a Group- Returns:
- MessagesRequestBuilder object when
is called - Since:
- v1
-
setMessageId
public MessagesRequest.MessagesRequestBuilder setMessageId(int messageId)
A method to set Message Id of a particular message from which developer can callor fetchPrevious()
- Parameters:
messageId
- Unique Id of a message- Returns:
- MessagesRequestBuilder object when
is called - Since:
- v1
-
setUnread
public MessagesRequest.MessagesRequestBuilder setUnread(boolean unread)
Method to set unread message while fetching- Parameters:
unread
- boolean parameter to consider or avoid unread messages while fetching messages usingMessagesRequest
- Returns:
- MessagesRequestBuilder object when
is called - Since:
- v1
-
hideMessagesFromBlockedUsers
public MessagesRequest.MessagesRequestBuilder hideMessagesFromBlockedUsers(boolean hideMessagesFromBlockedUsers)
Method to set parameters to hide or show message from blocked users while fetching- Parameters:
hideMessagesFromBlockedUsers
- boolean parameter to consider or avoid messages from blocked users while fetching messages usingMessagesRequest
- Returns:
- MessagesRequestBuilder object when
is called - Since:
- v1
-
setTimestamp
public MessagesRequest.MessagesRequestBuilder setTimestamp(long timestamp)
A method to set timestamp from which developer can callor fetchPrevious()
- Parameters:
timestamp
- timestamp from which developer wants to fetch previous or next messsages- Returns:
- MessagesRequestBuilder object when
is called - Since:
- v1
-
setSearchKeyword
public MessagesRequest.MessagesRequestBuilder setSearchKeyword(java.lang.String searchKeyword)
A method set Search keyword while fetching the messages- Parameters:
searchKeyword
- keyword which developer wants to search in the message list- Returns:
- MessagesRequestBuilder object when
is called - Since:
- v1
-
setUpdatedAfter
public MessagesRequest.MessagesRequestBuilder setUpdatedAfter(long updatedAfter)
A method set timestamp to get fetch messages updated/edited after that timestamp- Parameters:
updatedAfter
- timestamp to get messages updated after the specified timestamp- Returns:
- MessagesRequestBuilder object when
is called - Since:
- v1
-
updatesOnly
public MessagesRequest.MessagesRequestBuilder updatesOnly(boolean updatesOnly)
A method to set parameter to get edited/updated messages- Parameters:
updatesOnly
- boolean parameter show or hide edited/updated messages only- Returns:
- MessagesRequestBuilder object when
is called - Since:
- v1
-
setCategory
@Deprecated public MessagesRequest.MessagesRequestBuilder setCategory(java.lang.String category)
Deprecated.A method to set parameter to get the messages belonging to a specific category.- Parameters:
category
- The category for which the messages are to be fetched.- Returns:
- MessagesRequestBuilder object when
is called - Since:
- v1
-
setCategories
public MessagesRequest.MessagesRequestBuilder setCategories(java.util.List<java.lang.String> categories)
A method to set parameter to get the messages belonging to a specific category.- Parameters:
categories
- The list of categories for which the messages are to be fetched.- Returns:
- MessagesRequestBuilder object when
is called - Since:
- v1
-
setType
@Deprecated public MessagesRequest.MessagesRequestBuilder setType(java.lang.String type)
Deprecated.A method to set parameter to get the messages belonging to a specific type.- Parameters:
type
- The type for which the messages are to be fetched.- Returns:
- MessagesRequestBuilder object when
is called - Since:
- v1
-
setTypes
public MessagesRequest.MessagesRequestBuilder setTypes(java.util.List<java.lang.String> types)
A method to set parameter to get the messages belonging to a specific type.- Parameters:
types
- The list of types for which the messages are to be fetched.- Returns:
- MessagesRequestBuilder object when
is called - Since:
- v1
-
setParentMessageId
public MessagesRequest.MessagesRequestBuilder setParentMessageId(int parentMessageId)
A method to set parent id to retrieve messages only belonging to the particular thread.- Parameters:
parentMessageId
- The id of the message for which the messages are to be fetched.- Returns:
- MessagesRequestBuilder object when
is called - Since:
- v2
-
hideReplies
public MessagesRequest.MessagesRequestBuilder hideReplies(boolean hideReplies)
A method to exclude threaded messages while fecthing messages for Users/Groups.- Parameters:
hideReplies
- A boolean variable which when set to true excludes the threaded messages from the list of messages.- Returns:
- MessagesRequestBuilder object when
is called - Since:
- v2
-
hideDeletedMessages
public MessagesRequest.MessagesRequestBuilder hideDeletedMessages(boolean hideDeleted)
A method to hide deleted messages from list of messages to be fetched.- Parameters:
hideDeleted
- A boolean variable which when set to true excludes the deleted messages from the list of messages.- Returns:
- MessagesRequestBuilder object when
is called - Since:
- v2
-
setTags
public MessagesRequest.MessagesRequestBuilder setTags(java.util.List<java.lang.String> tags)
A method set the tags for which the messages are to be fetched- Parameters:
tags
- A list of strings that determines the list of tags for which the messages are to be fetched.- Returns:
- MessagesRequestBuilder object when
is called - Since:
- v3
-
withTags
public MessagesRequest.MessagesRequestBuilder withTags(boolean withTags)
A method to inform the SDK that the messages to be fetched are to be fetched along with the tags.- Parameters:
withTags
- This boolean when set to true will fetch the message along with the tags else the messages will be fetched without tags.- Returns:
- MessagesRequestBuilder object when
is called - Since:
- v3
-
build
public MessagesRequest build()
-
-