A leaderboard helper for a single recognition period: pages through ranked results and looks up the current user's own ranking, caching each lookup so repeated calls do not re-run the underlying query.


Properties

PropertyReturnsDescription
resultForCurrentUserRecognitionPeriodResultThe current user's own result within this period, if they have one.
resultsList<RecognitionPeriodResult>The first page (up to 100) of ranked results for this period, cached after the first call - see the paged and highestResults overloads, which share this same cache, so whichever is called first determines what every subsequent call on this instance returns.

Methods

getResults()

Returns: List<RecognitionPeriodResult>

The first page (up to 100) of ranked results for this period, cached after the first call - see the paged and highestResults overloads, which share this same cache, so whichever is called first determines what every subsequent call on this instance returns.

getResults(int startPos, int pageSize)

Returns: List<RecognitionPeriodResult>

A page of ranked results for this period, cached after the first call on this instance - a later call with different arguments (or a call to highestResults) still returns the first page that was actually loaded, since the underlying cache is shared and only loads once.

ParameterDescription
startPosthe zero-based index of the first result to return
pageSizethe maximum number of results to return

highestResults(int num)

Returns: List<RecognitionPeriodResult>

The highest-ranked results for this period, up to a maximum count, cached after the first call on this instance - shares its cache with the getResults overloads, so whichever of these methods is called first on this instance determines what every subsequent call returns, regardless of the arguments given.

ParameterDescription
numthe maximum number of results to return

getResultForCurrentUser()

Returns: RecognitionPeriodResult

The current user's own result within this period, if they have one.

findResult(BaseEntity participant)

Returns: RecognitionPeriodResult

Finds a specific participant's result within this period.

ParameterDescription
participantthe participant to find the result for
To get full access to the Kademi Hub existing customers can login here, or new customers can register here.