Class Certification

java.lang.Object
org.deltava.beans.academy.Certification
All Implemented Interfaces:
Serializable, Cloneable, Comparable<Certification>, Auditable, ComboAlias, ViewEntry

public class Certification extends Object implements ComboAlias, ViewEntry, Auditable, Comparable<Certification>
A bean to store Flight Academy certification data.
Since:
1.0
Version:
10.1
Author:
Luke
See Also:
  • Constructor Details

    • Certification

      public Certification(String name)
      Creates a new Certification bean.
      Parameters:
      name - the name
      Throws:
      NullPointerException - if name is null
  • Method Details

    • getName

      public String getName()
      Returns the certification name.
      Returns:
      the name
      See Also:
    • getCode

      public String getCode()
      Returns the Certification code.
      Returns:
      the code
      See Also:
    • getActive

      public boolean getActive()
      Returns whether the Certification is active.
      Returns:
      TRUE if it is active, otherwise FALSE
      See Also:
    • getVisible

      public boolean getVisible()
      Returns whether the achievement of this Certification is publicly visible.
      Returns:
      TRUE if visible, otherwise FALSE
      See Also:
    • getAutoEnroll

      public boolean getAutoEnroll()
      Returns whether students are automatically enrolled in this Course.
      Returns:
      TRUE if students are automatically enrolled, otherwise FALSE
      See Also:
    • getRideCount

      public int getRideCount()
      Returns how many Check Rides are required for this Certification.
      Returns:
      the number of Check Rides required
      See Also:
    • getStage

      public int getStage()
      Returns the certification stage.
      Returns:
      the stage number
      See Also:
    • getReqs

      public Prerequisite getReqs()
      Returns the pre-requisite code.
      Returns:
      the pre-requisite code
      See Also:
    • getReqCert

      public String getReqCert()
      Returns the specific Certification pre-requisite.
      Returns:
      the Certification code, or null if none
      See Also:
    • getReqCount

      public int getReqCount()
      Returns the number of Requirements for this Certification.
      Returns:
      the number of requirements
      See Also:
    • getRequirements

      public Collection<CertificationRequirement> getRequirements()
      Returns the requirements for this Certification.
      Returns:
      a Collection of CertificationRequirement beans
      See Also:
    • getAirlines

      public Collection<AirlineInformation> getAirlines()
      Returns the eligible virtual airlines for this Certification.
      Returns:
      a Collection of AirlineInformation beans
      See Also:
    • getExamNames

      public Collection<String> getExamNames()
      Returns the Examinations linked with this Certification.
      Returns:
      a Collection of Examination names
      See Also:
    • getRideEQ

      public Collection<String> getRideEQ()
      Returns the aircraft type suitable for the Check Ride.
      Returns:
      a Collection of equipment types, or empty for any
      See Also:
    • getRoles

      public Collection<String> getRoles()
      Returns the security roles required to enroll for this Certification.
      Returns:
      a Collection of role names
      See Also:
    • getEquipmentProgram

      public String getEquipmentProgram()
      Returns the equipment program required for pre-requisite flight legs or hours.
      Returns:
      the equipment type, or null if none or any
      See Also:
    • getFlightCount

      public int getFlightCount()
      Returns the number of pre-requisite flight legs or hours required to enroll for this Certification.
      Returns:
      the number of legs or hours
      See Also:
    • getDescription

      public String getDescription()
      Returns the Certification description and instructions.
      Returns:
      the description
    • getNetwork

      public OnlineNetwork getNetwork()
      Returns the Online network that grants a pilot rating when this Certification is completed.
      Returns:
      the OnlineNetwork, or null if none
    • getNetworkRatingCode

      public String getNetworkRatingCode()
      Returns the Online network's pilot rating code.
      Returns:
      the code
    • hasAirline

      public boolean hasAirline(String airlineCode)
      Returns whether this Flight Academy Certification is open to a particular virtual airline.
      Parameters:
      airlineCode - the virtual airline code.
      Returns:
      TRUE if the Certification is open to this airline, otherwise FALSE
      See Also:
    • addAirline

      public void addAirline(AirlineInformation ai)
      Adds an eligible virtual airline to this Certification.
      Parameters:
      ai - an AirlineInformation bean
      See Also:
    • setAirlines

      public void setAirlines(Collection<AirlineInformation> airlines)
      Assigns eligible virtual airlines to this Certification.
      Parameters:
      airlines - a Collection of AirlineInformation beans
      See Also:
    • addRequirement

      public void addRequirement(CertificationRequirement req)
      Adds a requirement for this Certification.
      Parameters:
      req - the requirement bean
      See Also:
    • setRequirements

      public void setRequirements(Collection<CertificationRequirement> reqs)
      Clears and updates the requirements for this Certification.
      Parameters:
      reqs - a Collection of CertificationRequirement beans
      See Also:
    • setReqCount

      public void setReqCount(int count)
      Updates the number of requirements for this Certification.
      Parameters:
      count - the number of requirements
      Throws:
      IllegalStateException - if requirement text already loaded
      See Also:
    • setCode

      public void setCode(String code)
      Updates the Certification code.
      Parameters:
      code - the code
      Throws:
      NullPointerException - if code is null
      See Also:
    • addExamName

      public void addExamName(String name)
      Adds an associated Examination name.
      Parameters:
      name - the Examination name
      See Also:
    • setExams

      public void setExams(Collection<String> exams)
      Clears and Updates the list of requirement Examinations.
      Parameters:
      exams - a Collecton of Examination names
      See Also:
    • addRideEQ

      public void addRideEQ(String eqType)
      Adds an eligible Check Ride equipment type.
      Parameters:
      eqType - the equipment type
      See Also:
    • setRideEQ

      public void setRideEQ(Collection<String> eqTypes)
      Clears and sets the Check Ride equipment types.
      Parameters:
      eqTypes - a Collection of equipment types
      See Also:
    • addRole

      public void addRole(String roleName)
      Adds a security role allowed to enroll for this Certification.
      Parameters:
      roleName - a security role name
      Throws:
      NullPointerException - if roleName is null
      See Also:
    • setRoles

      public void setRoles(Collection<String> roleNames)
      Clears and Updates the list of roles required to enroll.
      Parameters:
      roleNames - a Collecton of security role names
      See Also:
    • setStage

      public void setStage(int stage)
      Updates the stage number.
      Parameters:
      stage - the stage
      See Also:
    • setActive

      public void setActive(boolean isActive)
      Updates whether the certification is active.
      Parameters:
      isActive - TRUE if it is active, otherwise FALSE
      See Also:
    • setVisible

      public void setVisible(boolean isVisible)
      Updates whether this achievement of this certification is publicly visible.
      Parameters:
      isVisible - TRUE if visible, otherwise FALSE
      See Also:
    • setAutoEnroll

      public void setAutoEnroll(boolean autoEnroll)
      Updates whether students are automatically enrolled in this Course.
      Parameters:
      autoEnroll - TRUE if students are automatically enrolled, otherwise FALSE
      See Also:
    • setRideCount

      public void setRideCount(int cr)
      Updates the number of Check Rides required for this Certification.
      Parameters:
      cr - the number of Check Rides required
      See Also:
    • setName

      public void setName(String name)
      Updates the Certification name.
      Parameters:
      name - the name
      Throws:
      NullPointerException - if name is null
      See Also:
    • setReqs

      public void setReqs(Prerequisite req)
      Updates the Course prerequisite.
      Parameters:
      req - the Prerequisite
      See Also:
    • setReqCert

      public void setReqCert(String certCode)
      Sets the pre-requisite certification (if any).
      Parameters:
      certCode - the pre-requisite Certification code
      Throws:
      IllegalStateException - if getReqs() != REQ_SPECIFIC
    • setEquipmentProgram

      public void setEquipmentProgram(String eqProgram)
      Updates the equipment type program required for pre-requisite flights.
      Parameters:
      eqProgram - the equipment program name, or null for none or any
      See Also:
    • setFlightCount

      public void setFlightCount(int cnt)
      Updates the number of flight legs or hours required to enroll for this Certification.
      Parameters:
      cnt - the number of legs or hours
      See Also:
    • setDescription

      public void setDescription(String desc)
      Updates the certification description/instructions.
      Parameters:
      desc - the description
    • setNetwork

      public void setNetwork(OnlineNetwork net)
      Updates the online network that this Ceritification will grant a Pilot Rating for.
      Parameters:
      net - the OnlineNetwork, or null if none
    • setNetworkRatingCode

      public void setNetworkRatingCode(String code)
      Updates the rating code used by the online network.
      Parameters:
      code - the rating code
    • getComboName

      public String getComboName()
      Description copied from interface: ComboAlias
      Returns the visible name to use in the HTML <OPTION> element.
      Specified by:
      getComboName in interface ComboAlias
      Returns:
      The visible name for this entry
    • getComboAlias

      public String getComboAlias()
      Description copied from interface: ComboAlias
      Returns the alias to use in the HTML <OPTION> element.
      Specified by:
      getComboAlias in interface ComboAlias
      Returns:
      The alias for this entry
    • getRowClassName

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

      public int compareTo(Certification c2)
      Specified by:
      compareTo in interface Comparable<Certification>
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

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

      public String getAuditID()
      Description copied from interface: Auditable
      Returns the object ID for this auditable object.
      Specified by:
      getAuditID in interface Auditable
      Returns:
      the ID