Class TransferRequest

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

public class TransferRequest extends DatabaseBean implements ViewEntry
A class to store Equipment Program transfer requests. Since a checkride may be required for switches to additional equipment programs, this bean may also be used to track check ride workflows.
Since:
1.0
Version:
8.6
Author:
Luke
See Also:
  • Constructor Details

    • TransferRequest

      public TransferRequest(int pilotID, String eqType)
      Create a new Transfer Request.
      Parameters:
      pilotID - the Pilot's Database ID
      eqType - the Equipment Program to transfer to
      Throws:
      IllegalArgumentException - if pilotID is zero or negative
      NullPointerException - if eqType is null
  • Method Details

    • getAircraftType

      public String getAircraftType()
      Returns the preferred aircraft type for the Check Ride.
      Returns:
      the aircraft type
    • getEquipmentType

      public String getEquipmentType()
      Returns the Equipment Program for this Transfer Request.
      Returns:
      the equipment program name
    • getDate

      public Instant getDate()
      Returns the creation date of this Transfer Request.
      Returns:
      the date/time this request was created
      See Also:
    • getLatestCheckRideID

      public int getLatestCheckRideID()
      Returns the database ID of the latest assigned Check Ride.
      Returns:
      the database ID of the assigned Check Ride, or zero if none assigned
      See Also:
    • getCheckRideIDs

      public Collection<Integer> getCheckRideIDs()
      Returns the database IDs of all check rides associated with this Transfer Request.
      Returns:
      a Collection of database IDs
      See Also:
    • getStatus

      public TransferStatus getStatus()
      Returns the status of this Transfer Request.
      Returns:
      the status code
      See Also:
    • getCheckRideSubmitted

      public boolean getCheckRideSubmitted()
      Returns whether the associated Check Ride has been submitted.
      Returns:
      TRUE if the Check Ride was submitted or graded, otherwise FALSE
      See Also:
    • getRatingOnly

      public boolean getRatingOnly()
      Returns if this Transfer Request is for an additional rating only.
      Returns:
      TRUE if the rating is requested, not a program switch, otherwise FALSE
      See Also:
    • getSimulator

      public Simulator getSimulator()
      Returns the Pilot's preferred Simulator.
      Returns:
      a Simulator enum
      See Also:
    • setDate

      public void setDate(Instant dt)
      Updates the creation date of this Transfer Request.
      Parameters:
      dt - the date/time this request was created
      See Also:
    • setAircraftType

      public void setAircraftType(String acType)
      Updates the preferr aircraft type to use for the check ride.
      Parameters:
      acType - the aircraft type
    • addCheckRideID

      public void addCheckRideID(int id)
      Updates the database ID of the assigned Check Ride.
      Parameters:
      id - the Check Ride's database ID
      Throws:
      IllegalArgumentException - if id is negative
      See Also:
    • setCheckRideSubmitted

      public void setCheckRideSubmitted(boolean isSubmitted)
      Updates whether the associated Check Ride has been submitted
      Parameters:
      isSubmitted - TRUE if the Check Ride was submitted/graded, otherwise FALSE
      Throws:
      IllegalStateException - if no Check Ride ID was supplied
      See Also:
    • setStatus

      public void setStatus(TransferStatus status)
      Updates the status of this Transfer Request.
      Parameters:
      status - the new TransferStatus
      See Also:
    • setRatingOnly

      public void setRatingOnly(boolean ratingOnly)
      Updates if this Transfer Request is for an additional rating, instead of a program switch.
      Parameters:
      ratingOnly - TRUE if an additional rating only, otherwise FALSE
      See Also:
    • setSimulator

      public void setSimulator(Simulator sim)
      Updates the Pilot's preferred simulator.
      Parameters:
      sim - a Simulator
      See Also:
    • compareTo

      public int compareTo(Object o2)
      Compares two Transfer Requests by comparing their dates.
      Specified by:
      compareTo in interface Comparable<Object>
      Overrides:
      compareTo in class DatabaseBean
      See Also:
    • getRowClassName

      public String getRowClassName()
      Returns the CSS class name used to display this in a view table.
      Specified by:
      getRowClassName in interface ViewEntry
      Returns:
      the CSS class name