public final class MessageSearchQuery
extends java.lang.Object
BaseMessage
s that matches a given query
with given filters.
MessageSearchQuery
can be generated by using MessageSearchQuery.Builder.build()
Modifier and Type | Class and Description |
---|---|
static class |
MessageSearchQuery.Builder
A Builder class to build a MessageSearchQuery
|
static interface |
MessageSearchQuery.MessageSearchQueryResultHandler
Callback handler for
next(MessageSearchQueryResultHandler) |
static class |
MessageSearchQuery.Order
The order in which the query result will be based on.
|
Modifier and Type | Method and Description |
---|---|
static MessageSearchQuery |
buildFromSerializedData(byte[] data)
Builds
instance from serialized data generated by serialize() . |
java.lang.String |
getChannelCustomType()
Returns the current custom type of channel set as the search scope.
|
java.lang.String |
getChannelUrl()
Returns the current channel url set as the search scope.
|
java.lang.String |
getKeyword()
Returns the current search keyword.
|
int |
getLimit()
Returns the maximum number of
BaseMessage s per single query. |
long |
getMessageTimestampFrom()
Returns the start message timestamp set as the search range.
|
long |
getMessageTimestampTo()
Returns the end message timestamp set as the search range.
|
MessageSearchQuery.Order |
getOrder()
Returns the current order method.
|
java.util.List<java.lang.String> |
getTargetFields()
Returns target fields of the current query as the search scope.
|
int |
getTotalCount()
Returns the total count of results that matches the given search.
|
boolean |
hasNext()
Checks if there is a next page.
|
boolean |
isAdvancedQuery()
Returns whether the current search query should be an advanced query or not.
|
boolean |
isExactMatch()
Returns whether the current search query should be an exact match or not.
|
boolean |
isLoading()
Checks if the current query is in communication progress with server.
|
boolean |
isReverse()
Returns whether the current search result is set to be reversed or not.
|
void |
next(MessageSearchQuery.MessageSearchQueryResultHandler handler)
Gets the list of
BaseMessage s that matches the given search. |
byte[] |
serialize()
Serializes the
instance. |
public void next(MessageSearchQuery.MessageSearchQueryResultHandler handler)
BaseMessage
s that matches the given search. The queried result is passed to handler
as list
.
If this method is repeatedly called after each next()
is finished, it retrieves the following search results as BaseMessage
list.
If there is no more search results, an empty List
(not null
) is returned to handler
.handler
- a callback handler to get the queried result.public static MessageSearchQuery buildFromSerializedData(byte[] data)
MessageSearchQuery
instance from serialized data generated by serialize()
.data
- Serialized MessageSearchQuery
data.MessageSearchQuery
instance.public byte[] serialize()
MessageSearchQuery
instance. This byte array can be stored
in the database in your application. The instance can be restored by buildFromSerializedData(byte[])
.MessageSearchQuery
data.public boolean hasNext()
true
if there is a next page.public boolean isLoading()
true
if the current query is not finished.public int getLimit()
BaseMessage
s per single query.BaseMessage
s per single query.public boolean isReverse()
public java.lang.String getKeyword()
public boolean isExactMatch()
public java.lang.String getChannelUrl()
public java.lang.String getChannelCustomType()
public long getMessageTimestampFrom()
0
.public long getMessageTimestampTo()
Long.MAX_VALUE
.public MessageSearchQuery.Order getOrder()
public boolean isAdvancedQuery()
public java.util.List<java.lang.String> getTargetFields()
public int getTotalCount()
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.