Package org.deltava.beans.hr
Class Nomination
java.lang.Object
org.deltava.beans.DatabaseBean
org.deltava.beans.hr.Nomination
- All Implemented Interfaces:
Serializable
,Comparable<Object>
,IDBean
,ViewEntry
,Cacheable
A bean to track Senior Captain nominations. The first nomination is tracked in the Nomination and
NominationComment
beans, with further nominations resulting in another NominationComment.- Since:
- 3.3
- Version:
- 3.6
- Author:
- Luke
- See Also:
-
Nested Class Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a comment to this Nomination.int
Returns the number of comments on this nomination.Returns all comments on this Nomination.Returns the date of the nomination.Returns the calendar quarter for this Nomination, which may be different than the date it was created.Returns the CSS class for this item if rendered in a view table.int
getScore()
Returns this Nomination's score.Returns the status of the nomination.boolean
hasComment
(int authorID) Returns whether a particular user has created a comment.void
setCommentCount
(int comments) Updates the number of comments on this Nominationvoid
setCreatedOn
(Instant dt) Updates the date this nomination was created.void
Updates the calendar quarter of this Nomination.void
setScore
(int score) Updates this Nomination's score.void
Updates the nomination status.toString()
Methods inherited from class org.deltava.beans.DatabaseBean
cacheKey, compareTo, equals, getHexID, getID, hashCode, setID, validateID, validateID
-
Constructor Details
-
Nomination
public Nomination(int id) Creates the bean.- Parameters:
id
- the nominated Pilot's database ID- Throws:
IllegalArgumentException
- if id is zero or negative
-
-
Method Details
-
getCreatedOn
-
getStatus
-
getScore
public int getScore()Returns this Nomination's score.- Returns:
- the score
- See Also:
-
getQuarter
Returns the calendar quarter for this Nomination, which may be different than the date it was created.- Returns:
- the Qurater
- See Also:
-
getCommentCount
public int getCommentCount()Returns the number of comments on this nomination.- Returns:
- the number of comments
- See Also:
-
getComments
Returns all comments on this Nomination.- Returns:
- a Collection of NominationComments
-
hasComment
public boolean hasComment(int authorID) Returns whether a particular user has created a comment.- Parameters:
authorID
- the author's database ID- Returns:
- TRUE if the author has created a comment, otherwise FALSE
-
addComment
Adds a comment to this Nomination.- Parameters:
nc
- a NominationComment
-
setStatus
Updates the nomination status.- Parameters:
st
- the Status
-
setQuarter
Updates the calendar quarter of this Nomination.- Parameters:
q
- the Quarter- See Also:
-
setCreatedOn
Updates the date this nomination was created.- Parameters:
dt
- the date/time the nomination was created- Throws:
IllegalStateException
- if comments have been added- See Also:
-
setCommentCount
public void setCommentCount(int comments) Updates the number of comments on this Nomination- Parameters:
comments
- the number of comments- Throws:
IllegalStateException
- if comments have been added- See Also:
-
setScore
public void setScore(int score) Updates this Nomination's score.- Parameters:
score
- the score- See Also:
-
toString
-
getRowClassName
Returns the CSS class for this item if rendered in a view table.- Specified by:
getRowClassName
in interfaceViewEntry
- Returns:
- the CSS class name, or NULL if none
-