USER - the type of the userITEM - the type of the itemVOTE - the type of the voteTIME - the type of the timeENTRY - the type of the entry holding the voteDBO - the type of the database object holding the voteDAO - the type of the domain access object holding votesRESPONSE - the type of the response to the actionspublic class DatabaseVoteManager<USER,ITEM,VOTE,TIME,ENTRY extends net.ashwork.upvote.domain.VoteEntry<USER,ITEM,VOTE,TIME>,DBO,DAO extends InsertDao<DBO> & GetDao<DBO>,RESPONSE> extends AbstractDatabaseManager<ENTRY,DBO,DAO,RESPONSE> implements net.ashwork.upvote.manager.VoteManager<USER,ITEM,VOTE,TIME,ENTRY,RESPONSE>
VoteManager for a database.dao, persistSuccess, throwingError, transformer| Constructor and Description |
|---|
DatabaseVoteManager(DAO dao,
java.util.function.Function<ENTRY,DBO> transformer,
net.ashwork.upvote.domain.algorithm.TallyAlgorithm<DBO,RESPONSE> algorithm,
java.util.function.IntFunction<RESPONSE> persistSuccess,
java.util.function.Function<java.lang.Throwable,RESPONSE> throwingError)
A simple constructor.
|
| Modifier and Type | Method and Description |
|---|---|
RESPONSE |
tally() |
putEntrypublic DatabaseVoteManager(DAO dao, java.util.function.Function<ENTRY,DBO> transformer, net.ashwork.upvote.domain.algorithm.TallyAlgorithm<DBO,RESPONSE> algorithm, java.util.function.IntFunction<RESPONSE> persistSuccess, java.util.function.Function<java.lang.Throwable,RESPONSE> throwingError)
dao - the domain access object of the tabletransformer - a function to transform the vote entry to a database objectalgorithm - an algorithm to tally all vote database objects within the tablepersistSuccess - a function to convert a successful insertion to a responsethrowingError - a function to convert a thrown throwable to a response