Class Course
java.lang.Object
org.deltava.beans.DatabaseBean
org.deltava.beans.academy.Course
- All Implemented Interfaces:
Serializable
,Comparable<Object>
,IDBean
,ViewEntry
,Cacheable
A bean to store Flight Academy Course information.
- Since:
- 1.0
- Version:
- 8.0
- Author:
- Luke
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Sets the most recent Check Ride for this Course.void
Adds a new Comment entry.void
Adds a new Progress entry.int
Compares two Courses by comparing their start date/times and Pilot IDs.Returns the most recent check ride for this Course.getCode()
Returns the certification code.Returns any comments associated with this Course.Returns the date this Course was completed or abandoned.int
Returns the database ID of the assigned Instructor.Returns the date of the last comment.getName()
Returns the certification name.int
Returns the index of the next required Check Ride.int
Returns the database ID of the Pilot taking the course.Returns any progress entries associated with this Course.getProgressEntry
(int seq) Returns a particular progress entry.int
Returns the number of Check Rides required for this Course.Returns the CSS row class name if displayed in a view table.int
getStage()
Returns the stage value of this Course.Returns the date this Course was started.Returns the status of this Course.void
Updates the Certification code.void
setEndDate
(Instant dt) Updates the completion date for this Course.void
setInstructorID
(int id) Updates the database ID of the assigned Instructor.void
Updates the date of the last commnet.void
Updates the certification name for this Course.void
setPilotID
(int id) Updates the database ID of the enrolled Pilot.void
setRideCount
(int cr) Updates the number of Check Rides required for this Course.void
setStage
(int stage) Updates this Course's stage.void
setStartDate
(Instant dt) Updates the start date for this Course.void
Updates this Course's completion status.toString()
Methods inherited from class org.deltava.beans.DatabaseBean
cacheKey, equals, getHexID, getID, hashCode, setID, validateID, validateID
-
Constructor Details
-
Course
Creates a new Course bean.- Parameters:
name
- the Certification namepilotID
- the database ID of the Pilot taking the course- Throws:
NullPointerException
- if name is nullIllegalArgumentException
- if pilotID is zero or negative
-
-
Method Details
-
getName
-
getCode
-
getPilotID
public int getPilotID()Returns the database ID of the Pilot taking the course.- Returns:
- the database ID
- See Also:
-
getInstructorID
public int getInstructorID()Returns the database ID of the assigned Instructor.- Returns:
- the Instructor's database ID
- See Also:
-
getStatus
-
getStage
public int getStage()Returns the stage value of this Course.- Returns:
- the stage
- See Also:
-
getStartDate
Returns the date this Course was started.- Returns:
- the start date/time
- See Also:
-
getEndDate
Returns the date this Course was completed or abandoned.- Returns:
- the end date/time, or null if in progress
- See Also:
-
getLastComment
Returns the date of the last comment. This may not be populated.- Returns:
- the date/time of the last comment, or null
- See Also:
-
getProgress
Returns any progress entries associated with this Course.- Returns:
- a Collection of CourseProgress beans
- See Also:
-
getProgressEntry
Returns a particular progress entry.- Parameters:
seq
- the sequence number- Returns:
- a CourgeProgress bean, or null if not found
-
getComments
Returns any comments associated with this Course.- Returns:
- a Collection of CourseComment beans
- See Also:
-
getRideCount
public int getRideCount()Returns the number of Check Rides required for this Course.- Returns:
- the number of Check Rides
- See Also:
-
getNextCheckRide
public int getNextCheckRide()Returns the index of the next required Check Ride.- Returns:
- the Check Ride index
-
getCheckRides
Returns the most recent check ride for this Course.- Returns:
- a CheckRide object, or null if none
- See Also:
-
addProgress
Adds a new Progress entry. If an existing entry is found, it is overwritten.- Parameters:
cp
- the Progress bean- See Also:
-
addComment
Adds a new Comment entry.- Parameters:
c
- the Comment bean- See Also:
-
setCode
Updates the Certification code.- Parameters:
code
- the code- Throws:
NullPointerException
- if code is null- See Also:
-
setPilotID
public void setPilotID(int id) Updates the database ID of the enrolled Pilot.- Parameters:
id
- the database ID- Throws:
IllegalArgumentException
- if id is zero or negative or changes- See Also:
-
setInstructorID
public void setInstructorID(int id) Updates the database ID of the assigned Instructor.- Parameters:
id
- the database ID- See Also:
-
setName
Updates the certification name for this Course.- Parameters:
name
- the name- Throws:
NullPointerException
- if name is null- See Also:
-
setRideCount
public void setRideCount(int cr) Updates the number of Check Rides required for this Course.- Parameters:
cr
- the number of Check Rides- See Also:
-
setStatus
Updates this Course's completion status.- Parameters:
s
- the Status- See Also:
-
setStage
public void setStage(int stage) Updates this Course's stage.- Parameters:
stage
- the stage number- See Also:
-
setStartDate
Updates the start date for this Course.- Parameters:
dt
- the start date/time- See Also:
-
setEndDate
Updates the completion date for this Course.- Parameters:
dt
- the end date/time- Throws:
IllegalArgumentException
- if dt is before startDate- See Also:
-
setLastComment
Updates the date of the last commnet. This may not be populated.- Parameters:
dt
- the date/time of the last comment- See Also:
-
addCheckRide
Sets the most recent Check Ride for this Course.- Parameters:
cr
- the CheckRide object, or null- See Also:
-
getRowClassName
Returns the CSS row class name if displayed in a view table.- Specified by:
getRowClassName
in interfaceViewEntry
- Returns:
- the CSS class name
-
compareTo
Compares two Courses by comparing their start date/times and Pilot IDs.- Specified by:
compareTo
in interfaceComparable<Object>
- Overrides:
compareTo
in classDatabaseBean
- See Also:
-
toString
-