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 aLeaderboardand returns the instance as it was written to the database.voiddeleteLeaderboard(String nameOrId) Deletes theLeaderboardwith the name or identifier.getLeaderboard(String nameOrId) Gets a singleLeaderboardusing 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 existingLeaderboardinstance.
-
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 singleLeaderboardusing the specified identifier or name. Throws anLeaderboardNotFoundExceptionif not found.- Parameters:
nameOrId- the name or identifierLeaderboard.getId(),Leaderboard.getName()- Returns:
- the
Leaderboardinstance, never null
-
createLeaderboard
Creates aLeaderboardand returns the instance as it was written to the database.- Parameters:
leaderboard- theLeaderboard- Returns:
- the
Leaderboard
-
updateLeaderboard
Updates an existingLeaderboardinstance. Throwing an instance ofLeaderboardNotFoundExceptionif theLeaderboarddoes not exist.- Parameters:
leaderboardNameOrId- the name or identifierLeaderboard.getId(),Leaderboard.getName()leaderboard- theLeaderboard- Returns:
- the
Leaderboard
-
deleteLeaderboard
Deletes theLeaderboardwith the name or identifier.- Parameters:
nameOrId- the name or identifierLeaderboard.getId(),Leaderboard.getName()
-