Class Nomination

java.lang.Object
org.deltava.beans.DatabaseBean
org.deltava.beans.hr.Nomination
All Implemented Interfaces:
Serializable, Comparable<Object>, IDBean, ViewEntry, Cacheable

public class Nomination extends DatabaseBean implements ViewEntry
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:
  • 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

      public Instant getCreatedOn()
      Returns the date of the nomination.
      Returns:
      the nomination date/time
    • getStatus

      public Nomination.Status getStatus()
      Returns the status of the nomination.
      Returns:
      the status code
    • getScore

      public int getScore()
      Returns this Nomination's score.
      Returns:
      the score
      See Also:
    • getQuarter

      public Quarter 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

      public Collection<NominationComment> 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

      public void addComment(NominationComment nc)
      Adds a comment to this Nomination.
      Parameters:
      nc - a NominationComment
    • setStatus

      public void setStatus(Nomination.Status st)
      Updates the nomination status.
      Parameters:
      st - the Status
    • setQuarter

      public void setQuarter(Quarter q)
      Updates the calendar quarter of this Nomination.
      Parameters:
      q - the Quarter
      See Also:
    • setCreatedOn

      public void setCreatedOn(Instant dt)
      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

      public String toString()
      Overrides:
      toString in class Object
    • getRowClassName

      public String getRowClassName()
      Returns the CSS class for this item if rendered in a view table.
      Specified by:
      getRowClassName in interface ViewEntry
      Returns:
      the CSS class name, or NULL if none