Class PollOption

java.lang.Object
org.deltava.beans.DatabaseBean
org.deltava.beans.cooler.PollOption
All Implemented Interfaces:
Serializable, Comparable<Object>, ComboAlias, IDBean, Cacheable

public class PollOption extends DatabaseBean implements ComboAlias
A bean to store Water Cooler poll options.
Since:
1.0
Version:
8.0
Author:
Luke
See Also:
  • Constructor Details

    • PollOption

      public PollOption(int threadID, String name)
      Creates a new Water Cooler poll option.
      Parameters:
      threadID - the Message Thread database ID
      name - the option name
      Throws:
      IllegalArgumentException - if thread ID is zero or negative
      NullPointerException - if name is null
  • Method Details

    • getName

      public String getName()
    • getOptionID

      public int getOptionID()
    • getVotes

      public int getVotes()
    • getComboName

      public String getComboName()
      Description copied from interface: ComboAlias
      Returns the visible name to use in the HTML <OPTION> element.
      Specified by:
      getComboName in interface ComboAlias
      Returns:
      The visible name for this entry
    • getComboAlias

      public String getComboAlias()
      Description copied from interface: ComboAlias
      Returns the alias to use in the HTML <OPTION> element.
      Specified by:
      getComboAlias in interface ComboAlias
      Returns:
      The alias for this entry
    • setOptionID

      public void setOptionID(int id)
      Sets the option ID.
      Parameters:
      id - the new option ID
      Throws:
      IllegalArgumentException - if id is zero or negative
      See Also:
    • setVotes

      public void setVotes(int voteCount)
      Updates the number of votes.
      Parameters:
      voteCount - the number of votes
      See Also:
    • compareTo

      public int compareTo(Object o2)
      Specified by:
      compareTo in interface Comparable<Object>
      Overrides:
      compareTo in class DatabaseBean
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class DatabaseBean
    • toString

      public String toString()
      Overrides:
      toString in class Object