public class LCLeaderboard extends Object
Modifier and Type | Class and Description |
---|---|
static class |
LCLeaderboard.LCLeaderboardOrder |
static class |
LCLeaderboard.LCLeaderboardUpdateStrategy |
static class |
LCLeaderboard.LCLeaderboardVersionChangeInterval |
Modifier and Type | Field and Description |
---|---|
static int |
INVALID_VERSION |
static String |
MEMBER_TYPE_ENTITY |
static String |
MEMBER_TYPE_OBJECT |
static String |
MEMBER_TYPE_USER |
Modifier | Constructor and Description |
---|---|
protected |
LCLeaderboard(LCObject object) |
Modifier and Type | Method and Description |
---|---|
static io.reactivex.Observable<LCLeaderboard> |
create(String name,
LCLeaderboard.LCLeaderboardOrder order,
LCLeaderboard.LCLeaderboardUpdateStrategy updateStrategy,
LCLeaderboard.LCLeaderboardVersionChangeInterval versionChangeInterval)
create leaderboard with default member type(User).
|
static io.reactivex.Observable<LCLeaderboard> |
createWithMemberType(String memberType,
String name,
LCLeaderboard.LCLeaderboardOrder order,
LCLeaderboard.LCLeaderboardUpdateStrategy updateStrategy,
LCLeaderboard.LCLeaderboardVersionChangeInterval versionChangeInterval)
create leaderboard with customized member type
|
static LCLeaderboard |
createWithoutData(String name)
create instance with leaderboard name
|
static LCLeaderboard |
createWithoutData(String name,
String memberType)
create instance with leaderboard name and type.
|
io.reactivex.Observable<Boolean> |
destroy()
destroy current leaderboard.
|
static io.reactivex.Observable<LCLeaderboard> |
fetchByName(String name)
fetch leaderboard with name
|
io.reactivex.Observable<LCLeaderboardResult> |
getAroundInGroupResults(List<String> groupUserIds,
String targetId,
int limit,
List<String> selectMemberKeys,
List<String> includeStatistics)
get leaderboard results around target id within specified group.
|
io.reactivex.Observable<LCLeaderboardResult> |
getAroundResults(String targetId,
int skip,
int limit,
List<String> selectMemberKeys,
List<String> includeStatistics)
get leaderboard results around target id(user, object or entity).
|
Date |
getCreatedAt()
get create timestamp
|
io.reactivex.Observable<LCLeaderboardResult> |
getGroupResults(List<String> groupUserIds,
int skip,
int limit,
List<String> selectMemberKeys,
List<String> includeStatistics)
get group user's ranking.
|
static io.reactivex.Observable<LCStatisticResult> |
getMemberStatistics(String memberType,
String memberId)
get member statistics.
|
static io.reactivex.Observable<LCStatisticResult> |
getMemberStatistics(String memberType,
String memberId,
List<String> statisticNames)
get member statistics
|
Date |
getNextResetAt()
get next reset timestamp
|
LCLeaderboard.LCLeaderboardOrder |
getOrder()
get leaderboard order
|
io.reactivex.Observable<LCLeaderboardResult> |
getResults(int skip,
int limit,
List<String> selectMemberKeys,
List<String> includeStatistics)
get leaderboard results.
|
io.reactivex.Observable<LCLeaderboardResult> |
getResults(int skip,
int limit,
List<String> selectMemberKeys,
List<String> includeStatistics,
boolean withCount)
get leaderboard results.
|
String |
getStatisticName()
get statistic name
|
LCLeaderboard.LCLeaderboardUpdateStrategy |
getUpdateStrategy()
get leaderboard update strategy
|
static io.reactivex.Observable<LCStatisticResult> |
getUserStatistics(LCUser user)
get user's statistics
|
static io.reactivex.Observable<LCStatisticResult> |
getUserStatistics(LCUser user,
List<String> statisticNames)
get user's statistics
|
int |
getVersion()
get version
|
LCLeaderboard.LCLeaderboardVersionChangeInterval |
getVersionChangeInterval()
get version change interval
|
protected static <T extends Enum<T>> |
lookup(Class<T> enumType,
String name) |
io.reactivex.Observable<LCStatisticResult> |
queryGroupStatistics(List<String> targetKeys)
query multiple users/objects/entities statistic results.
|
static io.reactivex.Observable<LCStatisticResult> |
queryGroupStatistics(String memberType,
String statisticName,
List<String> targetKeys)
query a group of users/objects/entities statistic results.
|
io.reactivex.Observable<Boolean> |
reset()
reset current leaderboard.
|
void |
setVersion(int version) |
static io.reactivex.Observable<LCStatisticResult> |
updateStatistic(LCUser user,
Map<String,Double> values)
update user's statistic
|
static io.reactivex.Observable<LCStatisticResult> |
updateStatistic(LCUser user,
Map<String,Double> params,
boolean overwrite)
update user's statistic
|
io.reactivex.Observable<Boolean> |
updateUpdateStrategy(LCLeaderboard.LCLeaderboardUpdateStrategy strategy)
update current leaderboard's update strategy.
|
io.reactivex.Observable<Boolean> |
updateVersionChangeInterval(LCLeaderboard.LCLeaderboardVersionChangeInterval interval)
update current leaderboard's change interval
|
public static final int INVALID_VERSION
public static final String MEMBER_TYPE_USER
public static final String MEMBER_TYPE_ENTITY
public static final String MEMBER_TYPE_OBJECT
protected LCLeaderboard(LCObject object)
public String getStatisticName()
public LCLeaderboard.LCLeaderboardOrder getOrder()
public LCLeaderboard.LCLeaderboardUpdateStrategy getUpdateStrategy()
public LCLeaderboard.LCLeaderboardVersionChangeInterval getVersionChangeInterval()
public int getVersion()
public Date getNextResetAt()
public Date getCreatedAt()
public void setVersion(int version)
public static LCLeaderboard createWithoutData(String name)
name
- leaderboard namepublic static LCLeaderboard createWithoutData(String name, String memberType)
name
- leaderboard namememberType
- leaderboard member type:
MEMBER_TYPE_USER("_User"): leaderboard target is LCUser
MEMBER_TYPE_ENTITY("_Entity"): leaderboard target is any entity
LCObject Name: leaderboard target is LCObjectpublic static io.reactivex.Observable<LCStatisticResult> updateStatistic(LCUser user, Map<String,Double> values)
user
- user instancevalues
- statisticspublic static io.reactivex.Observable<LCStatisticResult> updateStatistic(LCUser user, Map<String,Double> params, boolean overwrite)
user
- user instanceparams
- statisticsoverwrite
- overwrite flagpublic static io.reactivex.Observable<LCStatisticResult> getUserStatistics(LCUser user)
user
- user instancepublic static io.reactivex.Observable<LCStatisticResult> getUserStatistics(LCUser user, List<String> statisticNames)
user
- user instancestatisticNames
- statistic namespublic static io.reactivex.Observable<LCStatisticResult> getMemberStatistics(String memberType, String memberId)
memberType
- member type
MEMBER_TYPE_USER("_User"): leaderboard target is LCUser
MEMBER_TYPE_ENTITY("_Entity"): leaderboard target is any entity
LCObject Name: leaderboard target is LCObjectmemberId
- member objectIdpublic static io.reactivex.Observable<LCStatisticResult> getMemberStatistics(String memberType, String memberId, List<String> statisticNames)
memberType
- member type
MEMBER_TYPE_USER("_User"): leaderboard target is LCUser
MEMBER_TYPE_ENTITY("_Entity"): leaderboard target is any entity
LCObject Name: leaderboard target is LCObjectmemberId
- member objectIdstatisticNames
- statistic namespublic static io.reactivex.Observable<LCStatisticResult> queryGroupStatistics(String memberType, String statisticName, List<String> targetKeys)
memberType
- member type.
MEMBER_TYPE_USER("_User"): leaderboard target is LCUser
MEMBER_TYPE_ENTITY("_Entity"): leaderboard target is any entity
MEMBER_TYPE_ENTITY("_Object"): leaderboard target is LCObjectstatisticName
- statistic names.targetKeys
- target ids.public io.reactivex.Observable<LCLeaderboardResult> getResults(int skip, int limit, List<String> selectMemberKeys, List<String> includeStatistics)
skip
- query offsetlimit
- query limitselectMemberKeys
- select member(user or object) keys(optional)includeStatistics
- include other statistics(optional)public io.reactivex.Observable<LCLeaderboardResult> getResults(int skip, int limit, List<String> selectMemberKeys, List<String> includeStatistics, boolean withCount)
skip
- query offsetlimit
- query limitselectMemberKeys
- select member(user or object) keys(optional)includeStatistics
- include other statistics(optional)withCount
- need count flag(optional)public io.reactivex.Observable<LCLeaderboardResult> getGroupResults(List<String> groupUserIds, int skip, int limit, List<String> selectMemberKeys, List<String> includeStatistics)
groupUserIds
- user id list.skip
- skip number.limit
- max result limitation.selectMemberKeys
- select member(user) keys(optional)includeStatistics
- include other statistics(optional)public io.reactivex.Observable<LCLeaderboardResult> getAroundResults(String targetId, int skip, int limit, List<String> selectMemberKeys, List<String> includeStatistics)
targetId
- target objectIdskip
- query offsetlimit
- query limitselectMemberKeys
- select object keys(optional)includeStatistics
- include other statistics(optional)public io.reactivex.Observable<LCLeaderboardResult> getAroundInGroupResults(List<String> groupUserIds, String targetId, int limit, List<String> selectMemberKeys, List<String> includeStatistics)
groupUserIds
- user id list.targetId
- target user id.limit
- query limit.selectMemberKeys
- select object keys(optional)includeStatistics
- include other statistics(optional)public io.reactivex.Observable<LCStatisticResult> queryGroupStatistics(List<String> targetKeys)
targetKeys
- target id list.public static io.reactivex.Observable<LCLeaderboard> create(String name, LCLeaderboard.LCLeaderboardOrder order, LCLeaderboard.LCLeaderboardUpdateStrategy updateStrategy, LCLeaderboard.LCLeaderboardVersionChangeInterval versionChangeInterval)
name
- nameorder
- orderupdateStrategy
- update strategy.versionChangeInterval
- version change interval.public static io.reactivex.Observable<LCLeaderboard> createWithMemberType(String memberType, String name, LCLeaderboard.LCLeaderboardOrder order, LCLeaderboard.LCLeaderboardUpdateStrategy updateStrategy, LCLeaderboard.LCLeaderboardVersionChangeInterval versionChangeInterval)
memberType
- member typename
- nameorder
- orderupdateStrategy
- update strategy.versionChangeInterval
- version change interval.public static io.reactivex.Observable<LCLeaderboard> fetchByName(String name)
name
- leaderboard namepublic io.reactivex.Observable<Boolean> reset()
public io.reactivex.Observable<Boolean> updateVersionChangeInterval(LCLeaderboard.LCLeaderboardVersionChangeInterval interval)
interval
- new change intervalpublic io.reactivex.Observable<Boolean> updateUpdateStrategy(LCLeaderboard.LCLeaderboardUpdateStrategy strategy)
strategy
- new update strategy.public io.reactivex.Observable<Boolean> destroy()
Copyright © 2020, 美味书签(北京)信息技术有限公司 All rights reserved.