Interface Votable

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

    Nested Classes
    Modifier and Type
    Interface
    Description
    static enum 
    The type of vote (negative or positive).
  • Method Summary

    Modifier and Type
    Method
    Description
    Returns the total sum of all votes for this object.
    void
    Sets the total votes for this object.
    boolean
    voteDown(String userid)
    Downvotes the object.
    boolean
    voteUp(String userid)
    Upvotes the object.
  • Method Details

    • 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