-
- All Known Subinterfaces:
ParaObject
- All Known Implementing Classes:
Address,App,Linker,Sysprop,Tag,Translation,User,Vote,Webhook
public interface VotableThis interface enables voting on an object. All core objects implement this and can be voted for.- Author:
- Alex Bogdanovski [alex@erudika.com]
- See Also:
Vote
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static classVotable.VoteValueThe type of vote (negative or positive).
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description IntegergetVotes()Returns the total sum of all votes for this object.voidsetVotes(Integer votes)Sets the total votes for this object.booleanvoteDown(String userid)Downvotes the object.booleanvoteUp(String userid)Upvotes the object.
-
-
-
Method Detail
-
voteUp
boolean voteUp(String userid)
Upvotes the object.- Parameters:
userid- id of voter- Returns:
- true if successful
-
voteDown
boolean voteDown(String userid)
Downvotes the object.- Parameters:
userid- id of voter- Returns:
- true if successful
-
getVotes
Integer getVotes()
Returns the total sum of all votes for this object. For example: (+6) + (-4) = 2- Returns:
- the total sum of votes
-
setVotes
void setVotes(Integer votes)
Sets the total votes for this object.- Parameters:
votes- the number of votes
-
-