类 LCIMConversationsQuery


  • public class LCIMConversationsQuery
    extends java.lang.Object
    • 构造器详细资料

      • LCIMConversationsQuery

        protected LCIMConversationsQuery​(LCIMClient client)
    • 方法详细资料

      • withMembers

        public LCIMConversationsQuery withMembers​(java.util.List<java.lang.String> peerIds)
        增加查询条件,指定聊天室的组员条件满足条件的才返回
        参数:
        peerIds - peer id list.
        返回:
        current instance.
      • withMembers

        public LCIMConversationsQuery withMembers​(java.util.List<java.lang.String> peerIds,
                                                  boolean includeSelf)
        增加查询条件,指定聊天室的组员条件满足条件的才返回
        参数:
        peerIds - peer client id list.
        includeSelf - 是否包含自己
        返回:
        current instance.
      • containsMembers

        public LCIMConversationsQuery containsMembers​(java.util.List<java.lang.String> peerIds)
        增加查询条件,指定聊天室的组员包含某些成员即可返回
        参数:
        peerIds - peer client id list.
        返回:
        current instance.
      • whereEqualTo

        public LCIMConversationsQuery whereEqualTo​(java.lang.String key,
                                                   java.lang.Object value)
        增加查询条件,当conversation的属性中对应的字段满足等于条件时即可返回
        参数:
        key - attribute key.
        value - attribute value
        返回:
        current instance.
      • whereLessThan

        public LCIMConversationsQuery whereLessThan​(java.lang.String key,
                                                    java.lang.Object value)
        增加查询条件,当conversation的属性中对应的字段满足小于条件时即可返回
        参数:
        key - attribute key.
        value - attribute value
        返回:
        current instance.
      • whereLessThanOrEqualsTo

        public LCIMConversationsQuery whereLessThanOrEqualsTo​(java.lang.String key,
                                                              java.lang.Object value)
        增加查询条件,当conversation的属性中对应的字段满足小于等于条件时即可返回
        参数:
        key - attribute key.
        value - attribute value.
        返回:
        current instance.
      • whereGreaterThan

        public LCIMConversationsQuery whereGreaterThan​(java.lang.String key,
                                                       java.lang.Object value)
        增加查询条件,当conversation的属性中对应的字段满足大于条件时即可返回
        参数:
        key - attribute key.
        value - attribute value.
        返回:
        current instance.
      • whereGreaterThanOrEqualsTo

        public LCIMConversationsQuery whereGreaterThanOrEqualsTo​(java.lang.String key,
                                                                 java.lang.Object value)
        增加查询条件,当conversation的属性中对应的字段满足大于等于条件时即可返回
        参数:
        key - attribute key.
        value - attribute value.
        返回:
        current instance.
      • whereNotEqualsTo

        public LCIMConversationsQuery whereNotEqualsTo​(java.lang.String key,
                                                       java.lang.Object value)
        增加查询条件,当conversation的属性中对应的字段满足不等于条件时即可返回
        参数:
        key - attribute key.
        value - attribute value.
        返回:
        current instance.
      • whereContainsIn

        public LCIMConversationsQuery whereContainsIn​(java.lang.String key,
                                                      java.util.Collection<?> value)
        增加查询条件,当conversation的属性中对应的字段对应的值包含在指定值中时即可返回
        参数:
        key - attribute key.
        value - value collection.
        返回:
        current instance. Notice: equals to whereContainedIn
      • whereContainedIn

        public LCIMConversationsQuery whereContainedIn​(java.lang.String key,
                                                       java.util.Collection<?> value)
        增加查询条件,当conversation的属性中对应的字段对应的值包含在指定值中时即可返回
        参数:
        key - attribute key.
        value - value collection.
        返回:
        current instance.
      • whereExists

        public LCIMConversationsQuery whereExists​(java.lang.String key)
        增加查询条件,当 conversation 的属性中对应的字段有值时即可返回
        参数:
        key - The key that should exist.
        返回:
        current instance.
      • whereDoesNotExist

        public LCIMConversationsQuery whereDoesNotExist​(java.lang.String key)
        增加查询条件,当 conversation 的属性中对应的字段没有值时即可返回
        参数:
        key - attribute key.
        返回:
        current instance.
      • whereNotContainsIn

        public LCIMConversationsQuery whereNotContainsIn​(java.lang.String key,
                                                         java.util.Collection<?> value)
        增加查询条件,当conversation的属性中对应的字段对应的值不包含在指定值中时即可返回
        参数:
        key - attribute key.
        value - attribute values
        返回:
        current instance.
      • whereContainsAll

        public LCIMConversationsQuery whereContainsAll​(java.lang.String key,
                                                       java.util.Collection<?> values)
        增加查询条件,当conversation的属性中对应的字段中的元素包含所有的值才可返回
        参数:
        key - attribute key.
        values - attribute values.
        返回:
        current instance.
      • whereContains

        public LCIMConversationsQuery whereContains​(java.lang.String key,
                                                    java.lang.String subString)
        增加查询条件,当conversation的属性中对应的字段对应的值包含此字符串即可返回
        参数:
        key - attribute key.
        subString - sub string.
        返回:
        current instance.
      • whereStartsWith

        public LCIMConversationsQuery whereStartsWith​(java.lang.String key,
                                                      java.lang.String prefix)
        增加查询条件,当conversation的属性中对应的字段对应的值以此字符串起始即可返回
        参数:
        key - attribute key.
        prefix - prefix string
        返回:
        current instance.
      • whereEndsWith

        public LCIMConversationsQuery whereEndsWith​(java.lang.String key,
                                                    java.lang.String suffix)
        增加查询条件,当conversation的属性中对应的字段对应的值以此字符串结束即可返回
        参数:
        key - attribute key.
        suffix - suffix string
        返回:
        current instance.
      • whereMatches

        public LCIMConversationsQuery whereMatches​(java.lang.String key,
                                                   java.lang.String regex)
        增加查询条件,当conversation的属性中对应的字段对应的值满足提供的正则表达式即可返回
        参数:
        key - attribute key.
        regex - regex pattern
        返回:
        current instance.
      • whereMatches

        public LCIMConversationsQuery whereMatches​(java.lang.String key,
                                                   java.lang.String regex,
                                                   java.lang.String modifiers)
        增加查询条件,当conversation的属性中对应的字段对应的值满足提供的正则表达式即可返回
        参数:
        key - attribute key.
        regex - regex pattern
        modifiers - 正则表达式的匹配模式,比如"-i"表示忽视大小写区分等
        返回:
        current instance.
      • whereNear

        public LCIMConversationsQuery whereNear​(java.lang.String key,
                                                LCGeoPoint point)
        增加一个基于地理位置的近似查询,当conversation的属性中对应字段对应的地理位置在pointer附近时即可返回
        参数:
        key - attribute key.
        point - GeoPoint
        返回:
        current instance.
      • whereWithinGeoBox

        public LCIMConversationsQuery whereWithinGeoBox​(java.lang.String key,
                                                        LCGeoPoint southwest,
                                                        LCGeoPoint northeast)
        增加一个基于地理位置的查询,当conversation的属性中有对应字段对应的地址位置在指定的矩形区域内时即可返回
        参数:
        key - 查询字段
        southwest - 矩形区域的左下角坐标
        northeast - 去兴趣鱼的右上角坐标
        返回:
        current instance.
      • whereWithinKilometers

        public LCIMConversationsQuery whereWithinKilometers​(java.lang.String key,
                                                            LCGeoPoint point,
                                                            double maxDistance)
        增加一个基于地理位置的近似查询,当conversation的属性中有对应的地址位置与指定的地理位置间距不超过指定距离时返回 地球半径为6371.0 千米
        参数:
        key - attribute key.
        point - 指定的地理位置
        maxDistance - 距离,以千米计算
        返回:
        current instance.
      • whereWithinMiles

        public LCIMConversationsQuery whereWithinMiles​(java.lang.String key,
                                                       LCGeoPoint point,
                                                       double maxDistance)
        增加一个基于地理位置的近似查询,当conversation的属性中有对应的地址位置与指定的地理位置间距不超过指定距离时返回
        参数:
        key - attribute key.
        point - 指定的地理位置
        maxDistance - 距离,以英里计算
        返回:
        current instance.
      • whereWithinRadians

        public LCIMConversationsQuery whereWithinRadians​(java.lang.String key,
                                                         LCGeoPoint point,
                                                         double maxDistance)
        增加一个基于地理位置的近似查询,当conversation的属性中有对应的地址位置与指定的地理位置间距不超过指定距离时返回
        参数:
        key - attribute key.
        point - 指定的地理位置
        maxDistance - 距离,以角度计算
        返回:
        current instance.
      • setLimit

        public LCIMConversationsQuery setLimit​(int limit)
        设置返回集合的大小上限
        参数:
        limit - 上限
        返回:
        current instance.
      • limit

        public LCIMConversationsQuery limit​(int limit)
        设置返回集合的大小上限
        参数:
        limit - 上限
        返回:
        current instance.
      • setSkip

        public LCIMConversationsQuery setSkip​(int skip)
        设置返回集合的起始位置,一般用于分页
        参数:
        skip - 起始位置跳过几个对象
        返回:
        current instance.
      • skip

        public LCIMConversationsQuery skip​(int skip)
        设置返回集合的起始位置,一般用于分页
        参数:
        skip - 起始位置跳过几个对象
        返回:
        current instance.
      • orderByAscending

        public LCIMConversationsQuery orderByAscending​(java.lang.String key)
        设置返回集合按照指定key进行增序排列
        参数:
        key - attribute key.
        返回:
        current instance.
      • orderByDescending

        public LCIMConversationsQuery orderByDescending​(java.lang.String key)
        设置返回集合按照指定key进行降序排列
        参数:
        key - attribute key.
        返回:
        current instance.
      • addAscendingOrder

        public LCIMConversationsQuery addAscendingOrder​(java.lang.String key)
        设置返回集合按照指定key进行升序排列,此 key 的优先级小于先前设置的 key
        参数:
        key - attribute key.
        返回:
        current instance.
      • addDescendingOrder

        public LCIMConversationsQuery addDescendingOrder​(java.lang.String key)
        设置返回集合按照指定key进行降序排列,此 key 的优先级小于先前设置的 key
        参数:
        key - attribute key.
        返回:
        current instance.
      • whereSizeEqual

        public LCIMConversationsQuery whereSizeEqual​(java.lang.String key,
                                                     int size)
        添加查询约束条件,查找key类型是数组,该数组的长度匹配提供的数值
        参数:
        key - attribute key.
        size - size value.
        返回:
        current instance.
      • isWithLastMessagesRefreshed

        public boolean isWithLastMessagesRefreshed()
        是否携带最后一条消息
        返回:
        flag indicating attaches with latest message.
      • setWithLastMessagesRefreshed

        public LCIMConversationsQuery setWithLastMessagesRefreshed​(boolean isWithLastMessageRefreshed)
        设置是否携带最后一条消息
        参数:
        isWithLastMessageRefreshed - flag indicating attaches with latest message.
        返回:
        current instance.
      • setCompact

        public LCIMConversationsQuery setCompact​(boolean isCompact)
        是否返回成员列表
        参数:
        isCompact - 为 true 的话则不返回,为 false 的话则返回成员列表,默认为 false
        返回:
        current instance.
      • setQueryPolicy

        public void setQueryPolicy​(LCQuery.CachePolicy policy)
        设置 IMConversationsQuery 的查询策略
        参数:
        policy - query policy
      • or

        public static LCIMConversationsQuery or​(java.util.List<LCIMConversationsQuery> queries)
        Constructs a IMConversationsQuery that is the or of the given queries.
        参数:
        queries - query list.
        返回:
        new conversation query instance.
      • setCacheMaxAge

        public void setCacheMaxAge​(long maxAgeInSecond)
        设置查询缓存的有效时间
        参数:
        maxAgeInSecond - max age of cache in seconds.
      • getCacheMaxAge

        public long getCacheMaxAge()
      • findInBackground

        public void findInBackground​(LCIMConversationQueryCallback callback)
        find in background.
        参数:
        callback - callback handler.
      • findTempConversationsInBackground

        public void findTempConversationsInBackground​(java.util.List<java.lang.String> conversationIds,
                                                      LCIMConversationQueryCallback callback)
        find temporary conversations in background.
        参数:
        conversationIds - conversation id list.
        callback - callback handler.
      • directFindInBackground

        public void directFindInBackground​(java.lang.String where,
                                           java.lang.String sort,
                                           int skip,
                                           int limit,
                                           int flag,
                                           LCIMConversationQueryCallback callback)
        direct find with conditions in background.
        参数:
        where - query condition
        sort - sort attributes
        skip - skip number
        limit - result maximum size
        flag - 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.