public class LCIMConversationsQuery extends Object
Modifier | Constructor and Description |
---|---|
protected |
LCIMConversationsQuery(LCIMClient client) |
Modifier and Type | Method and Description |
---|---|
LCIMConversationsQuery |
addAscendingOrder(String key)
设置返回集合按照指定key进行升序排列,此 key 的优先级小于先前设置的 key
|
LCIMConversationsQuery |
addDescendingOrder(String key)
设置返回集合按照指定key进行降序排列,此 key 的优先级小于先前设置的 key
|
LCIMConversationsQuery |
containsMembers(List<String> peerIds)
增加查询条件,指定聊天室的组员包含某些成员即可返回
|
void |
directFindInBackground(String where,
String sort,
int skip,
int limit,
int flag,
LCIMConversationQueryCallback callback)
direct find with conditions in background.
|
void |
findInBackground(LCIMConversationQueryCallback callback)
find in background.
|
void |
findTempConversationsInBackground(List<String> conversationIds,
LCIMConversationQueryCallback callback)
find temporary conversations in background.
|
long |
getCacheMaxAge() |
boolean |
isWithLastMessagesRefreshed()
是否携带最后一条消息
|
LCIMConversationsQuery |
limit(int limit)
设置返回集合的大小上限
|
static LCIMConversationsQuery |
or(List<LCIMConversationsQuery> queries)
Constructs a IMConversationsQuery that is the or of the given queries.
|
LCIMConversationsQuery |
orderByAscending(String key)
设置返回集合按照指定key进行增序排列
|
LCIMConversationsQuery |
orderByDescending(String key)
设置返回集合按照指定key进行降序排列
|
void |
setCacheMaxAge(long maxAgeInSecond)
设置查询缓存的有效时间
|
LCIMConversationsQuery |
setCompact(boolean isCompact)
是否返回成员列表
|
LCIMConversationsQuery |
setLimit(int limit)
设置返回集合的大小上限
|
void |
setQueryPolicy(LCQuery.CachePolicy policy)
设置 IMConversationsQuery 的查询策略
|
LCIMConversationsQuery |
setSkip(int skip)
设置返回集合的起始位置,一般用于分页
|
LCIMConversationsQuery |
setWithLastMessagesRefreshed(boolean isWithLastMessageRefreshed)
设置是否携带最后一条消息
|
LCIMConversationsQuery |
skip(int skip)
设置返回集合的起始位置,一般用于分页
|
LCIMConversationsQuery |
whereContainedIn(String key,
Collection<?> value)
增加查询条件,当conversation的属性中对应的字段对应的值包含在指定值中时即可返回
|
LCIMConversationsQuery |
whereContains(String key,
String subString)
增加查询条件,当conversation的属性中对应的字段对应的值包含此字符串即可返回
|
LCIMConversationsQuery |
whereContainsAll(String key,
Collection<?> values)
增加查询条件,当conversation的属性中对应的字段中的元素包含所有的值才可返回
|
LCIMConversationsQuery |
whereContainsIn(String key,
Collection<?> value)
增加查询条件,当conversation的属性中对应的字段对应的值包含在指定值中时即可返回
|
LCIMConversationsQuery |
whereDoesNotExist(String key)
增加查询条件,当 conversation 的属性中对应的字段没有值时即可返回
|
LCIMConversationsQuery |
whereEndsWith(String key,
String suffix)
增加查询条件,当conversation的属性中对应的字段对应的值以此字符串结束即可返回
|
LCIMConversationsQuery |
whereEqualTo(String key,
Object value)
增加查询条件,当conversation的属性中对应的字段满足等于条件时即可返回
|
LCIMConversationsQuery |
whereExists(String key)
增加查询条件,当 conversation 的属性中对应的字段有值时即可返回
|
LCIMConversationsQuery |
whereGreaterThan(String key,
Object value)
增加查询条件,当conversation的属性中对应的字段满足大于条件时即可返回
|
LCIMConversationsQuery |
whereGreaterThanOrEqualsTo(String key,
Object value)
增加查询条件,当conversation的属性中对应的字段满足大于等于条件时即可返回
|
LCIMConversationsQuery |
whereLessThan(String key,
Object value)
增加查询条件,当conversation的属性中对应的字段满足小于条件时即可返回
|
LCIMConversationsQuery |
whereLessThanOrEqualsTo(String key,
Object value)
增加查询条件,当conversation的属性中对应的字段满足小于等于条件时即可返回
|
LCIMConversationsQuery |
whereMatches(String key,
String regex)
增加查询条件,当conversation的属性中对应的字段对应的值满足提供的正则表达式即可返回
|
LCIMConversationsQuery |
whereMatches(String key,
String regex,
String modifiers)
增加查询条件,当conversation的属性中对应的字段对应的值满足提供的正则表达式即可返回
|
LCIMConversationsQuery |
whereNear(String key,
LCGeoPoint point)
增加一个基于地理位置的近似查询,当conversation的属性中对应字段对应的地理位置在pointer附近时即可返回
|
LCIMConversationsQuery |
whereNotContainsIn(String key,
Collection<?> value)
增加查询条件,当conversation的属性中对应的字段对应的值不包含在指定值中时即可返回
|
LCIMConversationsQuery |
whereNotEqualsTo(String key,
Object value)
增加查询条件,当conversation的属性中对应的字段满足不等于条件时即可返回
|
LCIMConversationsQuery |
whereSizeEqual(String key,
int size)
添加查询约束条件,查找key类型是数组,该数组的长度匹配提供的数值
|
LCIMConversationsQuery |
whereStartsWith(String key,
String prefix)
增加查询条件,当conversation的属性中对应的字段对应的值以此字符串起始即可返回
|
LCIMConversationsQuery |
whereWithinGeoBox(String key,
LCGeoPoint southwest,
LCGeoPoint northeast)
增加一个基于地理位置的查询,当conversation的属性中有对应字段对应的地址位置在指定的矩形区域内时即可返回
|
LCIMConversationsQuery |
whereWithinKilometers(String key,
LCGeoPoint point,
double maxDistance)
增加一个基于地理位置的近似查询,当conversation的属性中有对应的地址位置与指定的地理位置间距不超过指定距离时返回
地球半径为6371.0 千米
|
LCIMConversationsQuery |
whereWithinMiles(String key,
LCGeoPoint point,
double maxDistance)
增加一个基于地理位置的近似查询,当conversation的属性中有对应的地址位置与指定的地理位置间距不超过指定距离时返回
|
LCIMConversationsQuery |
whereWithinRadians(String key,
LCGeoPoint point,
double maxDistance)
增加一个基于地理位置的近似查询,当conversation的属性中有对应的地址位置与指定的地理位置间距不超过指定距离时返回
|
LCIMConversationsQuery |
withMembers(List<String> peerIds)
增加查询条件,指定聊天室的组员条件满足条件的才返回
|
LCIMConversationsQuery |
withMembers(List<String> peerIds,
boolean includeSelf)
增加查询条件,指定聊天室的组员条件满足条件的才返回
|
protected LCIMConversationsQuery(LCIMClient client)
public LCIMConversationsQuery withMembers(List<String> peerIds)
peerIds
- peer id list.public LCIMConversationsQuery withMembers(List<String> peerIds, boolean includeSelf)
peerIds
- peer client id list.includeSelf
- 是否包含自己public LCIMConversationsQuery containsMembers(List<String> peerIds)
peerIds
- peer client id list.public LCIMConversationsQuery whereEqualTo(String key, Object value)
key
- attribute key.value
- attribute valuepublic LCIMConversationsQuery whereLessThan(String key, Object value)
key
- attribute key.value
- attribute valuepublic LCIMConversationsQuery whereLessThanOrEqualsTo(String key, Object value)
key
- attribute key.value
- attribute value.public LCIMConversationsQuery whereGreaterThan(String key, Object value)
key
- attribute key.value
- attribute value.public LCIMConversationsQuery whereGreaterThanOrEqualsTo(String key, Object value)
key
- attribute key.value
- attribute value.public LCIMConversationsQuery whereNotEqualsTo(String key, Object value)
key
- attribute key.value
- attribute value.public LCIMConversationsQuery whereContainsIn(String key, Collection<?> value)
key
- attribute key.value
- value collection.public LCIMConversationsQuery whereContainedIn(String key, Collection<?> value)
key
- attribute key.value
- value collection.public LCIMConversationsQuery whereExists(String key)
key
- The key that should exist.public LCIMConversationsQuery whereDoesNotExist(String key)
key
- attribute key.public LCIMConversationsQuery whereNotContainsIn(String key, Collection<?> value)
key
- attribute key.value
- attribute valuespublic LCIMConversationsQuery whereContainsAll(String key, Collection<?> values)
key
- attribute key.values
- attribute values.public LCIMConversationsQuery whereContains(String key, String subString)
key
- attribute key.subString
- sub string.public LCIMConversationsQuery whereStartsWith(String key, String prefix)
key
- attribute key.prefix
- prefix stringpublic LCIMConversationsQuery whereEndsWith(String key, String suffix)
key
- attribute key.suffix
- suffix stringpublic LCIMConversationsQuery whereMatches(String key, String regex)
key
- attribute key.regex
- regex patternpublic LCIMConversationsQuery whereMatches(String key, String regex, String modifiers)
key
- attribute key.regex
- regex patternmodifiers
- 正则表达式的匹配模式,比如"-i"表示忽视大小写区分等public LCIMConversationsQuery whereNear(String key, LCGeoPoint point)
key
- attribute key.point
- GeoPointpublic LCIMConversationsQuery whereWithinGeoBox(String key, LCGeoPoint southwest, LCGeoPoint northeast)
key
- 查询字段southwest
- 矩形区域的左下角坐标northeast
- 去兴趣鱼的右上角坐标public LCIMConversationsQuery whereWithinKilometers(String key, LCGeoPoint point, double maxDistance)
key
- attribute key.point
- 指定的地理位置maxDistance
- 距离,以千米计算public LCIMConversationsQuery whereWithinMiles(String key, LCGeoPoint point, double maxDistance)
key
- attribute key.point
- 指定的地理位置maxDistance
- 距离,以英里计算public LCIMConversationsQuery whereWithinRadians(String key, LCGeoPoint point, double maxDistance)
key
- attribute key.point
- 指定的地理位置maxDistance
- 距离,以角度计算public LCIMConversationsQuery setLimit(int limit)
limit
- 上限public LCIMConversationsQuery limit(int limit)
limit
- 上限public LCIMConversationsQuery setSkip(int skip)
skip
- 起始位置跳过几个对象public LCIMConversationsQuery skip(int skip)
skip
- 起始位置跳过几个对象public LCIMConversationsQuery orderByAscending(String key)
key
- attribute key.public LCIMConversationsQuery orderByDescending(String key)
key
- attribute key.public LCIMConversationsQuery addAscendingOrder(String key)
key
- attribute key.public LCIMConversationsQuery addDescendingOrder(String key)
key
- attribute key.public LCIMConversationsQuery whereSizeEqual(String key, int size)
key
- attribute key.size
- size value.public boolean isWithLastMessagesRefreshed()
public LCIMConversationsQuery setWithLastMessagesRefreshed(boolean isWithLastMessageRefreshed)
isWithLastMessageRefreshed
- flag indicating attaches with latest message.public LCIMConversationsQuery setCompact(boolean isCompact)
isCompact
- 为 true 的话则不返回,为 false 的话则返回成员列表,默认为 falsepublic void setQueryPolicy(LCQuery.CachePolicy policy)
policy
- query policypublic static LCIMConversationsQuery or(List<LCIMConversationsQuery> queries)
queries
- query list.public void setCacheMaxAge(long maxAgeInSecond)
maxAgeInSecond
- max age of cache in seconds.public long getCacheMaxAge()
public void findInBackground(LCIMConversationQueryCallback callback)
callback
- callback handler.public void findTempConversationsInBackground(List<String> conversationIds, LCIMConversationQueryCallback callback)
conversationIds
- conversation id list.callback
- callback handler.public void directFindInBackground(String where, String sort, int skip, int limit, int flag, LCIMConversationQueryCallback callback)
where
- query conditionsort
- sort attributesskip
- skip numberlimit
- result maximum sizeflag
- query flag:
0 - Normal,
1 - don't need member list within a conversation item,
2 - attach last message data within a conversation item.callback
- callback function.Copyright © 2020, 美味书签(北京)信息技术有限公司 All rights reserved.