Class MongoLeaderboardDao
java.lang.Object
dev.getelements.elements.dao.mongo.MongoLeaderboardDao
- All Implemented Interfaces:
LeaderboardDao
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateLeaderboard
(Leaderboard leaderboard) Creates aLeaderboard
and returns the instance as it was written to the database.void
deleteLeaderboard
(String leaderboardNameOrId) Deletes theLeaderboard
with the name or identifier.dev.morphia.Datastore
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.getMongoLeaderboard
(String nameOrId) void
setBeanMapper
(MapperRegistry beanMapperRegistry) void
setDatastore
(dev.morphia.Datastore datastore) void
setMongoDBUtils
(MongoDBUtils mongoDBUtils) void
setValidationHelper
(ValidationHelper validationHelper) updateLeaderboard
(String leaderboardNameOrId, Leaderboard leaderboard) Updates an existingLeaderboard
instance.
-
Constructor Details
-
MongoLeaderboardDao
public MongoLeaderboardDao()
-
-
Method Details
-
createLeaderboard
Description copied from interface:LeaderboardDao
Creates aLeaderboard
and returns the instance as it was written to the database.- Specified by:
createLeaderboard
in interfaceLeaderboardDao
- Parameters:
leaderboard
- theLeaderboard
- Returns:
- the
Leaderboard
-
getLeaderboards
Description copied from interface:LeaderboardDao
Lists all leaderboards, specifying offset and count.- Specified by:
getLeaderboards
in interfaceLeaderboardDao
- Parameters:
offset
- the offset in the datasetcount
- the number or results to return- Returns:
- the
Pagination<Leaderboard>
-
getLeaderboards
Description copied from interface:LeaderboardDao
Lists all leaderboards, specifying offset and count, as well as a search query.- Specified by:
getLeaderboards
in interfaceLeaderboardDao
- Parameters:
offset
- the offset in the datasetcount
- the number or results to return- Returns:
- the
Pagination<Leaderboard>
-
getLeaderboard
Description copied from interface:LeaderboardDao
Gets a singleLeaderboard
using the specified identifier or name. Throws anLeaderboardNotFoundException
if not found.- Specified by:
getLeaderboard
in interfaceLeaderboardDao
- Parameters:
nameOrId
- the name or identifierLeaderboard.getId()
,Leaderboard.getName()
- Returns:
- the
Leaderboard
instance, never null
-
getMongoLeaderboard
-
updateLeaderboard
Description copied from interface:LeaderboardDao
Updates an existingLeaderboard
instance. Throwing an instance ofLeaderboardNotFoundException
if theLeaderboard
does not exist.- Specified by:
updateLeaderboard
in interfaceLeaderboardDao
- Parameters:
leaderboardNameOrId
- the name or identifierLeaderboard.getId()
,Leaderboard.getName()
leaderboard
- theLeaderboard
- Returns:
- the
Leaderboard
-
deleteLeaderboard
Description copied from interface:LeaderboardDao
Deletes theLeaderboard
with the name or identifier.- Specified by:
deleteLeaderboard
in interfaceLeaderboardDao
- Parameters:
leaderboardNameOrId
- the name or identifierLeaderboard.getId()
,Leaderboard.getName()
-
getValidationHelper
-
setValidationHelper
-
getMongoDBUtils
-
setMongoDBUtils
-
getDatastore
public dev.morphia.Datastore getDatastore() -
setDatastore
@Inject public void setDatastore(dev.morphia.Datastore datastore) -
getBeanMapper
-
setBeanMapper
-