- All Known Subinterfaces:
ParaObject
- All Known Implementing Classes:
Address
,App
,Linker
,Sysprop
,Tag
,Translation
,User
,Vote
,Webhook
public interface Votable
This interface enables voting on an object.
All core objects implement this and can be voted for.
- Author:
- Alex Bogdanovski [[email protected]]
- See Also:
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic enum
The type of vote (negative or positive). -
Method Summary
-
Method Details
-
voteUp
Upvotes the object.- Parameters:
userid
- id of voter- Returns:
- true if successful
-
voteDown
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
Sets the total votes for this object.- Parameters:
votes
- the number of votes
-