Class PollOption
java.lang.Object
org.deltava.beans.DatabaseBean
org.deltava.beans.cooler.PollOption
- All Implemented Interfaces:
Serializable, Comparable<Object>, ComboAlias, IDBean, Cacheable
A bean to store Water Cooler poll options.
- Since:
- 1.0
- Version:
- 8.0
- Author:
- Luke
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionPollOption(int threadID, String name) Creates a new Water Cooler poll option. -
Method Summary
Modifier and TypeMethodDescriptionintReturns the alias to use in the HTML <OPTION> element.Returns the visible name to use in the HTML <OPTION> element.getName()intintgetVotes()inthashCode()voidsetOptionID(int id) Sets the option ID.voidsetVotes(int voteCount) Updates the number of votes.toString()Methods inherited from class DatabaseBean
cacheKey, equals, getHexID, getID, setID, validateID, validateIDModifier and TypeMethodDescriptioncacheKey()Returns the cache key for this object.booleangetHexID()Returns the hexadecimal database ID of this object.intgetID()Returns the database ID of this object.voidsetID(int id) Update the database row ID of this bean.static voidvalidateID(int oldID, int newID) Validates a database ID.static voidvalidateID(int oldID, int newID, boolean allowZero) Validates a database ID.
-
Constructor Details
-
PollOption
Creates a new Water Cooler poll option.- Parameters:
threadID- the Message Thread database IDname- the option name- Throws:
IllegalArgumentException- if thread ID is zero or negativeNullPointerException- if name is null
-
-
Method Details
-
getName
-
getOptionID
public int getOptionID() -
getVotes
public int getVotes() -
getComboName
Description copied from interface:ComboAliasReturns the visible name to use in the HTML <OPTION> element.- Specified by:
getComboNamein interfaceComboAlias- Returns:
- The visible name for this entry
-
getComboAlias
Description copied from interface:ComboAliasReturns the alias to use in the HTML <OPTION> element.- Specified by:
getComboAliasin interfaceComboAlias- 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
- Specified by:
compareToin interfaceComparable<Object>- Overrides:
compareToin classDatabaseBean
-
hashCode
public int hashCode()- Overrides:
hashCodein classDatabaseBean
-
toString
-