Package dev.getelements.elements.sdk.dao
Interface LeaderboardDao
- All Known Implementing Classes:
MongoLeaderboardDao
public interface LeaderboardDao
Provides CRUD operations for Leaderboard instances in the database.
-
Method Summary
Modifier and TypeMethodDescriptioncreateLeaderboard
(Leaderboard leaderboard) Creates aLeaderboard
and returns the instance as it was written to the database.void
deleteLeaderboard
(String nameOrId) Deletes theLeaderboard
with the name or identifier.getLeaderboard
(String nameOrId) Gets a singleLeaderboard
using the specified identifier or name.getLeaderboards
(int offset, int count) Lists all leaderboards, specifying offset and count.getLeaderboards
(int offset, int count, String search) Lists all leaderboards, specifying offset and count, as well as a search query.updateLeaderboard
(String leaderboardNameOrId, Leaderboard leaderboard) Updates an existingLeaderboard
instance.
-
Method Details
-
getLeaderboards
Lists all leaderboards, specifying offset and count.- Parameters:
offset
- the offset in the datasetcount
- the number or results to return- Returns:
- the
Pagination<Leaderboard>
-
getLeaderboards
Lists all leaderboards, specifying offset and count, as well as a search query.- Parameters:
offset
- the offset in the datasetcount
- the number or results to return- Returns:
- the
Pagination<Leaderboard>
-
getLeaderboard
Gets a singleLeaderboard
using the specified identifier or name. Throws anLeaderboardNotFoundException
if not found.- Parameters:
nameOrId
- the name or identifierLeaderboard.getId()
,Leaderboard.getName()
- Returns:
- the
Leaderboard
instance, never null
-
createLeaderboard
Creates aLeaderboard
and returns the instance as it was written to the database.- Parameters:
leaderboard
- theLeaderboard
- Returns:
- the
Leaderboard
-
updateLeaderboard
Updates an existingLeaderboard
instance. Throwing an instance ofLeaderboardNotFoundException
if theLeaderboard
does not exist.- Parameters:
leaderboardNameOrId
- the name or identifierLeaderboard.getId()
,Leaderboard.getName()
leaderboard
- theLeaderboard
- Returns:
- the
Leaderboard
-
deleteLeaderboard
Deletes theLeaderboard
with the name or identifier.- Parameters:
nameOrId
- the name or identifierLeaderboard.getId()
,Leaderboard.getName()
-