Class InternshipOpportunity

java.lang.Object
src.model.internship.InternshipOpportunity

public class InternshipOpportunity extends Object
InternshipOpportunity Class
  • Field Details

    • MAX_NUM_SLOTS

      public static final int MAX_NUM_SLOTS
      The maximum number of slots that an internship opportunity is allowed to open.
      See Also:
    • internshipTitle

      private String internshipTitle
    • description

      private String description
    • internshipLevel

      private InternshipLevel internshipLevel
    • preferredMajor

      private String preferredMajor
    • applicationOpeningDate

      private LocalDate applicationOpeningDate
    • applicationClosingDate

      private LocalDate applicationClosingDate
    • status

      private Status status
    • companyName

      private String companyName
    • companyRepresentatives

      private ArrayList<CompanyRepresentative> companyRepresentatives
    • numberOfSlots

      private int numberOfSlots
    • numberOfSlotsLeft

      private int numberOfSlotsLeft
    • visible

      private boolean visible
  • Constructor Details

    • InternshipOpportunity

      public InternshipOpportunity(String internshipTitle, String description, InternshipLevel internshipLevel, String preferredMajor, LocalDate applicationOpeningDate, LocalDate applicationClosingDate, String companyName, ArrayList<CompanyRepresentative> companyRepresentatives, int numberOfSlots)
      Constructs a InternshipOpportunity instance with all required fields.
      Parameters:
      internshipTitle - The title of the internship opportunity.
      description - The description of the internship opportunity.
      internshipLevel - The internship level of the internship opportunity.
      preferredMajor - The preferred major of the internship opportunity.
      applicationOpeningDate - The application opening date of the internship opportunity. Must not be null.
      applicationClosingDate - The application closing date of the internship opportunity. Must not be null and must be on or after the opening date.
      companyName - The name of the company offering the internship opportunity.
      companyRepresentatives - The list of company representatives associated with the internship opportunity. Can be null.
      numberOfSlots - The maximum number of slots available for this internship opportunity. Must be greater than 0 and less than or equal to MAX_NUM_SLOTS.
      Throws:
      IllegalArgumentException - if the application dates are invalid (null or closing date is before opening date).
      IllegalArgumentException - if the number of slots is outside the valid range (1 to MAX_NUM_SLOTS).
  • Method Details

    • getInternshipTitle

      public String getInternshipTitle()
      Getter for internshipTitle
      Returns:
      internshipTitle
    • setInternshipTitle

      public void setInternshipTitle(String internshipTitle)
      Setter for internshipTitle
      Parameters:
      internshipTitle - the internshipTitle to set
    • getDescription

      public String getDescription()
      Getter for description
      Returns:
      description
    • setDescription

      public void setDescription(String description)
      Setter for description
      Parameters:
      description - the description to set
    • getInternshipLevel

      public InternshipLevel getInternshipLevel()
      Getter for internshipLevel
      Returns:
      internshipLevel
    • setInternshipLevel

      public void setInternshipLevel(InternshipLevel internshipLevel)
      Setter for internshipLevel
      Parameters:
      internshipLevel - the internshipLevel to set
    • getPreferredMajor

      public String getPreferredMajor()
      Getter for preferredMajor
      Returns:
      preferredMajor
    • setPreferredMajor

      public void setPreferredMajor(String preferredMajor)
      Setter for preferredMajor
      Parameters:
      preferredMajor - the preferredMajor to set
    • getApplicationOpeningDate

      public LocalDate getApplicationOpeningDate()
      Getter for applicationOpeningDate
      Returns:
      applicationOpeningDate
    • setApplicationOpeningDate

      public void setApplicationOpeningDate(LocalDate applicationOpeningDate)
      Setter for applicationOpeningDate
      Parameters:
      applicationOpeningDate - the applicationOpeningDate to set
    • getApplicationClosingDate

      public LocalDate getApplicationClosingDate()
      Getter for applicationClosingDate
      Returns:
      applicationClosingDate
    • setApplicationClosingDate

      public void setApplicationClosingDate(LocalDate applicationClosingDate)
      Setter for applicationClosingDate
      Parameters:
      applicationClosingDate - the applicationClosingDate to set
    • getStatus

      public Status getStatus()
      Getter for status
      Returns:
      status
    • setStatus

      public void setStatus(Status status)
      Setter for status
      Parameters:
      status - the status to set
    • getCompanyName

      public String getCompanyName()
      Getter for companyName
      Returns:
      companyName
    • setCompanyName

      public void setCompanyName(String companyName)
      Setter for companyName
      Parameters:
      companyName - the companyName to set
    • getCompanyRepresentatives

      public ArrayList<CompanyRepresentative> getCompanyRepresentatives()
      Getter for companyRepresentatives
      Returns:
      companyRepresentatives
    • addCompanyRepresentative

      public int addCompanyRepresentative(CompanyRepresentative repToAdd)
      Adds repToAdd to companyRepresentatives
      Parameters:
      repToAdd - the CompanyRepresentative to add
      Returns:
      0 if successful, 1 if unsuccessful
    • deleteCompanyRepresentative

      public int deleteCompanyRepresentative(CompanyRepresentative repToDelete)
      Deletes repToDelete from companyRepresentatives
      Parameters:
      repToDelete - the CompanyRepresentative to delete
      Returns:
      0 if successful, 1 if unsuccessful
    • getNumberOfSlots

      public int getNumberOfSlots()
      Getter for numberOfSlots
      Returns:
      numberOfSlots
    • setNumberOfSlots

      public int setNumberOfSlots(int numberOfSlots)
      Setter for numberOfSlots
      Parameters:
      numberOfSlots - the numberOfSlots to set. Must be between 1 and MAX_NUM_SLOTS inclusive.
      Returns:
      0 if successful, 1 if unsuccessful.
    • decrementSlotsLeft

      public void decrementSlotsLeft()
      Decrements the number of slots left for this internship opportunity by 1.
    • incrementSlotsLeft

      public void incrementSlotsLeft()
      Increments the number of slots left for this internship opportunity by 1.
    • getSlotsLeft

      public int getSlotsLeft()
      Getter for numberOfSlotsLeft
      Returns:
      the number of slots remaining for this internship opportunity
    • getVisibility

      public boolean getVisibility()
      Getter for visible
      Returns:
      visible
    • setVisibility

      public void setVisibility(boolean visible)
      Setter for visible
      Parameters:
      visible - the visible to set